Home >Database >Mysql Tutorial >How to set up passwordless login in mysql
The specific method is as follows:
First we need to stop the MySQL service, the command is as follows:
service mysql stop
Then, in the /etc/my.cnf configuration file Find [mysqld], Add configuration: skip-grant-tables
For example:
[mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock skip-name-resolve skip-grant-tables
Finally we can save the file.
Now, we can log in to MySQL without a password. If you forget your password, you can change it now.
Recommended tutorial: mysql tutorial
The above is the detailed content of How to set up passwordless login in mysql. For more information, please follow other related articles on the PHP Chinese website!