Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to turn on remote login function in MYSQL

2025-05-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article introduces you how to turn on the remote login function in MYSQL, the content is very detailed, interested friends can refer to, hope to be helpful to you.

Utilization

View source

Print?

1 select * from mysql.user

Check out all the MYSQL users and find that by default, the values of the host fields of these records are all localhost

This host field indicates which machines can use this account to connect to the local MYSQL.

Localhost, of course, represents the local machine. So by default, other machines cannot be connected.

So to open a remote connection to an account, just change the host field corresponding to that account to that IP.

For example:

View source

Print?

1 update user set host = 192.168.230.2 where user=ninty

After this command is executed, it will be executed:

View source

Print?

1 flush privileges

To refresh the permission configuration information for all users and make the settings take effect in a timely manner.

Or restart MYSQL.

Change the host of the ninty account to 192.168.230.2, so that the 192.168.230.2 machine is allowed to connect to the local MYSQL through the ninty account.

However, it is still not possible to use other accounts.

If you change the host of ninty to 192.168.230.2, only 192.168.230.2 can connect to the MYSQL of this machine through the account ninty.

No other machines (including this machine) can be connected.

If you want to set up an account so that any IP can log in, just change host to%.

If only the IP of the network segment 192.168.230 can log in, change the host to:

192.168.230.%

Here are some common error messages:

ERROR 1130 (00000): Host AAAAA-8HK8AISO is not allowed to connect to this MySQL server

AAAAA-8HK8AISO should be the machine name of the local machine. This error occurs when the MYSQL server forbids the local machine to connect with the corresponding account.

At this time, you can change to an account that allows your computer to connect.

ERROR 1045 (28000): Access denied for user (using password: YES)

This error is usually an error in the user name or password, which should be allowed to connect to the local computer, otherwise it should be reported as the error above.

ERROR 2003 (HY000): Cant connect to MySQL server on 192.168.230.2 (10061)

This should be due to the lack of connection to MYSQL on the network, maybe the IP or the port is wrong, or the server does not open MYSQL or the firewall blocks the connection.

On how to turn on the remote login function in MYSQL to share here, I hope the above content can be of some help to you, you can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report