Home  >  Article  >  Database  >  How to set up passwordless login in mysql

How to set up passwordless login in mysql

王林
王林forward
2020-06-05 09:23:209508browse

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!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete