这是什么问题? 192.168.4.204就是本机C:\Program Files\McAfee\Network Security Manager\MySQL\bin>mysql -h192.168.4.204 -uroot -p
Enter password: ******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 28799
Server version: 5.0.68-enterprise-nt-log MySQL Enterprise Server (Commercial)Type 'help;' or '\h' for help. Type '\c' to clear the buffer.mysql> select version();
+--------------------------+
| version() |
+--------------------------+
| 5.0.68-enterprise-nt-log |
+--------------------------+
1 row in set (0.00 sec)mysql> use mysql
Database changed
mysql> select host,user from user;
+---------------+------+
| host | user |
+---------------+------+
| 192.168.4.204 | root |
+---------------+------+
1 row in set (0.00 sec)mysql> grant all privileges on *.* to root@'%' indentified by 'qwerty';
ERROR 1064 (42000): 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 'indentified by 'qwerty'' at line 1
mysql>
Enter password: ******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 28799
Server version: 5.0.68-enterprise-nt-log MySQL Enterprise Server (Commercial)Type 'help;' or '\h' for help. Type '\c' to clear the buffer.mysql> select version();
+--------------------------+
| version() |
+--------------------------+
| 5.0.68-enterprise-nt-log |
+--------------------------+
1 row in set (0.00 sec)mysql> use mysql
Database changed
mysql> select host,user from user;
+---------------+------+
| host | user |
+---------------+------+
| 192.168.4.204 | root |
+---------------+------+
1 row in set (0.00 sec)mysql> grant all privileges on *.* to root@'%' indentified by 'qwerty';
ERROR 1064 (42000): 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 'indentified by 'qwerty'' at line 1
mysql>
ERROR 1045 (28000): Access denied for user 'root'@'192.168.4.204' (using password: YES)
mysql> grant all privileges on *.* to root@'%' IDENTIFIEDBY by 'qwerty';
ERROR 1064 (42000): 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 'IDENTIFIEDBY by 'qwerty'' at line 1
mysql> grant all privileges on *.* to root@'%' IDENTIFIED BY by 'qwerty';
ERROR 1064 (42000): 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 'by 'qwerty'' at line 1
mysql> grant all on *.* to root@'%' indentified by 'qwerty';
ERROR 1064 (42000): 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 'indentified by 'qwerty'' at line 1
mysql>
ERROR 1045 (28000): Access denied for user 'root'@'192.168.4.204' (using password: YES)
mysql>
注意identified
Enter password: ******用的root上个礼拜还可以,现在突然不行
贴结果
用这个贴子中的方法进去,然后把你自己加入 root@localhost
mysql> SHOW GRANTS FOR 'root'@'192.168.4.204';
+-----------------------------------------------------------------------------------------------------------------------
---+
| Grants for [email protected]
|
+-----------------------------------------------------------------------------------------------------------------------
---+
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.4.204' IDENTIFIED BY PASSWORD '*AA1420F182E88B9E5F874F6FBE7459291E8F460
1' |
+-----------------------------------------------------------------------------------------------------------------------
---+
1 row in set (0.02 sec)mysql>
MYSQL是安装在本机还是远程?
+---------------+------+
| host | user |
+---------------+------+
| 192.168.4.204 | root |
+---------------+------+
1 row in set (0.00 sec)从你这个显示,你的机器上已经没有 root@localhost 了。你可以试一下你当前登录的身份。mysql> select current_user//
+----------------+
| current_user |
+----------------+
| root@localhost |
+----------------+
1 row in set (0.06 sec)mysql>看一下是什么?然后直接
SHOW GRANTS
看一 下。mysql> SHOW GRANTS//
+---------------------------
----------------------------
| Grants for root@localhost+---------------------------
----------------------------
| GRANT ALL PRIVILEGES ON *.
E809DDACAF96AF0FD78ED04B6A26
+---------------------------
----------------------------
1 row in set (0.00 sec)mysql>
root@'192.168.4.204'
所有权限都有,
就是不能grant all privileges on *.* to root@'%' identified by 'qwerty';
邪门了。所有测试都是在MySQL Server端,Server IP: 192.168.4.204
mysql> select current_user;
+--------------------+
| current_user |
+--------------------+
| [email protected] |
+--------------------+
1 row in set (0.00 sec)mysql> show grants;
+-----------------------------------------------------------------------------------------------------------------------
---+
| Grants for [email protected]
|
+-----------------------------------------------------------------------------------------------------------------------
---+
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.4.204' IDENTIFIED BY PASSWORD '*AA1420F182E88B9E5F874F6FBE7459291E8F460
1' |
+-----------------------------------------------------------------------------------------------------------------------
---+
1 row in set (0.00 sec)mysql>
mysql> select current_user;
+--------------------+
| current_user |
+--------------------+
| [email protected] |
+--------------------+
1 row in set (0.00 sec)mysql> show grants;
+-----------------------------------------------------------------------------------------------------------------------
---+
| Grants for [email protected]
|
+-----------------------------------------------------------------------------------------------------------------------
---+
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.4.204' IDENTIFIED BY PASSWORD '*AA1420F182E88B9E5F874F6FBE7459291E8F460
1' |
+-----------------------------------------------------------------------------------------------------------------------
---+
1 row in set (0.00 sec)mysql> grant all privileges on *.* to root@'127.0.0.1' identified by 'qwerty';
ERROR 1045 (28000): Access denied for user 'root'@'192.168.4.204' (using password: YES)
mysql> grant all privileges on *.* to root@'localhost' identified by 'qwerty';
ERROR 1045 (28000): Access denied for user 'root'@'192.168.4.204' (using password: YES)
mysql> grant all privileges on *.* to root@'%' identified by 'qwerty';
ERROR 1045 (28000): Access denied for user 'root'@'192.168.4.204' (using password: YES)
mysql>
mysql> create user 'root'@'localhost' identified by 'qwerty';
Query OK, 0 rows affected (0.06 sec)mysql> grant all privileges on *.* to root@'localhost';
ERROR 1045 (28000): Access denied for user 'root'@'192.168.4.204' (using password: YES)
mysql>
快崩溃了谢谢大虾们关注,我也尝试去问问官方MySQL.