This article mainly introduces the actual solution for implementing remote MySQL login in linux. The specific solution includes the table change method, authorization method, and other related solutions, the following is a detailed description of the article. I hope you will get something after reading it.
1. ALTER 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 Law
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. The last Method
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.
The above content is a description of MySQL remote login in linux, and I hope it will help you in this regard.