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

A brief Analysis of solving the mysql problem of client connection

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly gives you a brief introduction to solving the mysql problem of client connection. You can check the relevant professional terms on the Internet or find some related books to supplement them. We will not dabble here. Let's go straight to the topic of solving the problem of client connection mysql. I hope it can bring you some practical help.

This error occurs when you try to connect to your mysql:

ERROR 1130: Host '192.168.16.145' is not allowed to connect to this MySQL server

Change the meter.

It may be that your account is not allowed to log in remotely, only in localhost. At this time, as long as on the computer in localhost, after logging in to mysql, change the "host" entry in the "user" table in the "mysql" database from "localhost" to "%"

Mysql-u root-pvmwaremysql > use mysql;mysql > update user set host ='% 'where user =' root';mysql > select host, user from user

two。 Authorization law.

(1) for example, if you want myuser to connect to the mysql CVM from any host using mypassword

GRANT ALL PRIVILEGES ON *. * TO 'myuser'@'%' IDENTIFIED BY' mypassword' WITH GRANT OPTION

(2) if you want to allow the user myuser to connect to the mysql server from the host with ip 192.168.16.145, and use mypassword as the password

GRANT ALL PRIVILEGES ON *. * TO 'root'@'192.168.16.145' IDENTIFIED BY' mypassword' WITH GRANT OPTION

(3) the last sentence must be added!

Mysql > flush privileges

The following error occurred:

Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. Java.net.ConnectException: Connection refused: connect

At this point, you need to log in to the server and set up your mysql and restart mysql as follows

Vim / etc/mysql/my.cnf

Bind-address = 127.0.0.1 in the configuration

Change this item to bind-address = 0.0.0.0

Unbind MySQL Server to the local address!

Save exit after (wq)

Sudo / etc/init.d/mysql restart (restart the mysql service) or sudo service mysql restart

To solve the mysql problem of client connection, let's stop here. If you want to know about other related issues, you can continue to pay attention to our industry information. Our section will capture some industry news and professional knowledge to share with you every day.

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