Connect to mysql server without sudo

后端 未结 9 1177
暖寄归人
暖寄归人 2020-12-02 08:39

The command:

mysql -u root -p

gives the error:

ERROR 1698 (28000): Access denied for user \'root\'@\'localhost\'
         


        
9条回答
  •  渐次进展
    2020-12-02 08:52

    You can use the below query:

    GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' IDENTIFIED BY 'password';
    

    This query is enough.

提交回复
热议问题