Home > Database > Mysql Tutorial > How to set up passwordless login in mysql

How to set up passwordless login in mysql

王林
Release: 2020-06-05 09:23:20
forward
9672 people have browsed it

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
Copy after login

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
Copy after login

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!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template