The following articles mainly introduce the actual solutions for implementing remote MySQL login in linux, including the table change method and authorization method. If you are interested in these two solutions, you can click to read the following articles. I hope you will have a better understanding of them.
Solution:
1. Change the table. It may be that your account is not allowed to log on remotely, but only on localhost. At this time, you only need to log in to MySQL on the computer of localhost, and change the "host" entry in the "user" table in the "MySQL" database to "%" from "localhost"
- MySQL -u root -p123
- MySQL>use MySQL;
- MySQL>update user set host = '%' where user = 'root';
- MySQL>select host, user from user;
2. Authorization method.
For example, if you want kevin to use mypassword to connect to the MySQL server from any host.
- GRANT ALL PRIVILEGES ON *.* TO 'kevin'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
If you want to allow user kevin to connect to the MySQL server from a host with ip address 192.168.101.234, and use mypassword as the password
- GRANT ALL PRIVILEGES ON *.* TO 'kevin'@'192.168.101.234' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
3. if this is the case, it will not work. (generally, it will work in windows) modify the following configuration file. (in linux, you can find the corresponding configuration file under your MySQL installation directory)
- vi /etc/MySQL/my.cnf
Comment out
- #bind-address = 127.0.0.1
The above content is an introduction to MySQL remote login in linux. I hope you will get some benefits.