mysql5,数据库有已有一些数据!phpmyadmin中执行以下语句alter table 'ss' add 'bb' varchar(50) not null default '0';不能通过,报错,请问什么原因?

解决方案 »

  1.   

    语法:
    alter table 表名 add 列名 数据类型如:alter table test_table add name_new varchar(10) default '';
      

  2.   


    alter table `ss` add `bb` varchar(50) not null default '0'; 
      

  3.   


    mysql> alter table `ss` add `bb` varchar(50) not null default '0';
    ERROR 1142 : ALTER command denied to user 'eaa'@'bbb' for table 'ss'
      

  4.   


    假设你的数据库名字:DBV
    在MySQL命令行执行。
    grant alter  on DBV.ss to 'eaa'@'bbb';
    flush privileges;
      

  5.   


    mysql> alter table 'ss' add 'bb' varchar(50) not null default '0';
    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 ''ss' add 'bb' varchar(50) not null default '0'' at line 1
    mysql>