2019年5月14日 星期二

【MYSQL】mysql8.0的錯誤記錄


問題1 :安裝完成後執行任意指令出現 :
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

解決方法:alter user user() identified by "你的密碼";




mysql> alter user user() identified by "1234";

Query OK, 0 rows affected (0.01 sec)



問題2 :新增人員給予密碼無法執行出現問題 :
mysql> grant all privileges on *.* to 'rosalie'@'localhost' identified by '1234';
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 'identified by '1234'' at line 1

Mysql 8.0以後的版本不適用以上指令創建,需分開指令執行

解決方法:



mysql> create user 'rosalie'@'localhost' identified by '1234';
Query OK, 0 rows affected (0.00 sec)

mysql> grant all on *.* to 'rosalie'@'localhost';
Query OK, 0 rows affected (0.01 sec)





沒有留言:

張貼留言

【MYSQL】MYSQL的SYS表說明(版本8.0)

mysql> use sys Reading table information for completion of table and column names You can turn off this feature to get a quicker s...