MySQL常見問題解決辦法整理
問題一:本機創建用戶後,該用戶無法登錄。
問題描述:
通過root創建一個數據庫,然後指定該數據庫允許訪問的用戶名
mysql> CREATE DATABASE keystone; mysql> GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' IDENTIFIED BY '123456'; mysql> FLUSH PRIVILEGES;
# mysql -u keystone -p123456 -D keystone ERROR 1045 (28000): Access denied for user 'keystone'@'localhost' (using password: YES)
mysql> GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY '123456';