Ubuntu 管理心得

搜尋此網誌

2021年11月27日 星期六

Cannpt login as mysql user root from normal user account

 cf: https://askubuntu.com/questions/766334/cant-login-as-mysql-user-root-from-normal-user-account-in-ubuntu-16-04


$ sudo mysql -u root
mysql> DROP USER 'root'@'localhost';
mysql> CREATE USER 'root'@'localhost' IDENTIFIED BY '<root_password>';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION; 
mysql> FLUSH PRIVILEGES;
 
In above, One replace 'root' e.g. with 'chiao' to create the a mysql user as root.  

沒有留言:

張貼留言

網誌存檔