是因为你登录Mysql用的帐号权限不够,没有创建数据库的权限

解决方案 »

  1.   

    mysqladmin -u root -p yourpassword
      

  2.   

    >mysql -u root 
    登陆先
    然后用sql语句创建
    SQL可是很通用的哦
      

  3.   

    运行mysql/bin/mysql.exe
    >mysql -u root -h localhost -pXXXX 注意-p后跟密码,不要空格!如果登陆成功!
    使用创建语句
    CREATE DATABASE my_data;
      

  4.   

    还是,不行呀。 ekingelon(顽石心)又出现了这样:
    ERROR 1064: MySQL server version for the right syntax to use near 'mysql -u root-h localhost -proot
    CREATE DATABASE my_data' at l
      

  5.   

    新装上的mysql没有口令啊。你直接
    mysql -uroot 
    就可以了。
      

  6.   

    我现在:
    ...\bin>mysql -uroot 登录后,
    create database my_data; 
    也querry OK.....
    use my_data 
    也database changed。
    但,create table food(foodid not null,foodname char(32) not null,primar key(foodid));
    时竟然出现:ERROR 1064: You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near 'key(foodid))' at line 1
    我那里错了?
      

  7.   

    哈哈,搂主改成这样试试:
    create table food(
    foodid int not null,
    foodname char(32) not null,
    primary key(foodid)
    );
    以上SQL在我机器上测试通过;-)