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)为什么前一个语句是错的?
grant all on kekan.* to manager@"%" identified by "99516";
方法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;
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)为什么前一个语句是错的?
使用标准 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;