我研究了一下午,终于有点头绪了,但是还有一点问题,怎么给ROOT加上密码?我在MYSQL的USER表中直接添加密码,但是没有用。
第一次运行的时候设定的那个帐号有什么用,又不能拿来登陆数据库

解决方案 »

  1.   

    mysql> grant all on kekan.* to manager@% identified by "99516";
    ERROR 1064: You have an error in your SQL syntax.  Check the manual that corresonds to your MySQL server version for the right syntax to use near '% identifie by "99516"' at line 1
    mysql> grant all on kekan.* to manager@localhost identified by "99516";
    Query OK, 0 rows affected (0.00 sec)为什么前一个语句是错的?
      

  2.   

    grant all on kekan.* to manager@"%" identified by "99516";
      

  3.   

    方法1:
    使用标准 SQL 语句shell> mysql -u root mysql
    mysql> UPDATE user SET Password=PASSWORD('new_password')
        ->     WHERE user='root';
    mysql> FLUSH PRIVILEGES;
    方法2:
    使用 mysqladmin 程序shell> mysqladmin -u root password new_password方法3: 
    使用 Grant 语句identified by "99516";
    就是加密码的,你可以shell> mysql -u root mysql
    mysql> GRANT ALL PRIVILEGES ON *.* TO root@"%"
         >  IDENTIFIED BY 'your_password' WITH GRANT OPTION;