MYSQL Access denied for user 'root'@'localhost'

后端 未结 3 1696
我寻月下人不归
我寻月下人不归 2020-12-11 15:49

I did the following steps to use MySQL in Ubuntu:

sudo aptitude install php5-mysql mysql-server
sudo service mysql stop
sudo mysqld_safe --skip-grant-tables          


        
3条回答
  •  爱一瞬间的悲伤
    2020-12-11 16:08

    System like Ubuntu prefers to use auth_socket plugin for root account by default. It will try to authenticate by comparing your username in DB and process which makes mysql request; it is described in here

    The socket plugin checks whether the socket user name (the operating system user name) matches the MySQL user name specified by the client program to the server, and permits the connection only if the names match.

    Instead you may want to back with the mysql_native_password, which will require user/password to authenticate.

    About the method to achieve that, I recommend you checking this out instead.

提交回复
热议问题