mysql> grant all on *.* to 'root'@'localhost' identified by '123456'; Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> show warnings; +---------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Level | Code | Message | +---------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Warning | 1287 | Using GRANT statement to modify existing user's properties other than privileges is deprecated and will be removed in future release. Use ALTER USER statement for this operation. | +---------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.00 sec)
Using GRANT statement to modify existing user’s properties other than privileges is deprecated and will be removed in future release. Use ALTER USER statement for this operation.
就是说,grant已经要废弃了,要用alter User 修改
1 2 3 4 5 6 7 8 9 10 11
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('123456'); Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> show warnings -> ; +---------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Level | Code | Message | +---------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Warning | 1287 | 'SET PASSWORD FOR <user> = PASSWORD('<plaintext_password>')' is deprecated and will be removed in a future release. Please use SET PASSWORD FOR <user> = '<plaintext_password>' instead | +---------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.00 sec)
‘SET PASSWORD FOR = PASSWORD(‘‘)’ is deprecated and will be removed in a future release. Please use SET PASSWORD FOR = ‘‘ instead
这种设置密码的方式也已经被废弃了,要使用
SET PASSWORD FOR = ‘‘
不过warnings只是警告,执行是成功的,只是说下一版本要去掉PASSWORD,继续查找问题。
好,那就用明文的方式再试一次
1 2
mysql> SET PASSWORD FOR 'root'@'localhost'='123456'; Query OK, 0 rows affected, 1 warning (0.00 sec)
又出现一个warnings,那就再看下有什么warnings的
1 2 3 4 5 6 7 8 9 10
mysql> SET PASSWORD FOR 'root'@'localhost'='123456'; Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> show warnings; +-------+------+------------------------------------------------------------------------------------------------------------+ | Level | Code | Message | +-------+------+------------------------------------------------------------------------------------------------------------+ | Note | 1699 | SET PASSWORD has no significance for user 'root'@'localhost' as authentication plugin does not support it. | +-------+------+------------------------------------------------------------------------------------------------------------+ 1 row in set (0.00 sec)
SET PASSWORD has no significance for user ‘root’@’localhost’ as authentication plugin does not support it.