This article shares with you the method of opening the remote login connection for MySQL on the Linux platform. Friends who have the same needs can refer to the following
I often encounter the problem of remote access to mysql during the development process. I need to search every time. It feels too troublesome. I will record it here so that I can refer to it later.
First access the mysql of this machine (use ssh to log in to the terminal and enter the following command):
mysql -uroot -p
Enter After logging in with the password, enter the following statement:
use mysql; grant all privileges on *.* to 'user'@'%' identified by 'password' with grant option;
Among them:
user is the user name
mysql default is root
password is the password itself Set
% to represent any host, or you can specify the IP address
to allow access from any remote host.
Example:
grant all privileges on *.* to 'root'@'192.168.1.100' identified by '' with grant option;
That is: allow 192.168.1.100 to log in as the root user without a password.
The above is the detailed content of Detailed introduction to enabling remote login with mysql on Linux platform. For more information, please follow other related articles on the PHP Chinese website!