Unable to connect to remote MySQL server (10061)

A local connection is included in MySQL.

But remote access (My laptop) is disabled

Can't connect to MySQL server on "host" (10061)`. 

My port always opens 3306.

Here is my configuration file ( /etc/mysql/my.cnf ):

 #bind-address 0.0.0.0 !includedir /etc/mysql/conf.d/ !includedir /etc/mysql/mysql.conf.d/ 

And the status of MySQL:

 mysql start/running, process 15204 
+11
source share
5 answers

To allow remote access to MySQL, you must comment out the binding (you did) and skip the network configuration in the configuration file.

Then you must ensure that the user is allowed remote access. Check this user:

 SELECT User, Host FROM mysql.user; 

If your user here has "127.0.0.1" or "localhost" specified as the host, you do not have remote access.

Change this as follows:

 UPDATE mysql.user SET HOST='%' WHERE User='__here_your_username'; 

Hidden privileges:

 FLUSH PRIVILEGES; 

"%" is a wildcard for "all hosts."

+18
source

To allow remote access to MySQL installed on Ubuntu, you need to access the file at this location:

 /etc/mysql/mysql.conf.d/mysqld.cnf 

There you will comment on the following line: bind-address = 127.0.0.1

basically change: bind-address = 127.0.0.1 to: # bind-address = 127.0.0.1

Now you either restart the computer or just the mySQL service using the follwing command: sudo / etc / init.d / mysql restart

+13
source

In my case, the LAMP stack is installed on Oracle VM from Ubuntu 18.04

Here is my update for mysql configuration file: /etc/mysql/mysql.conf.d/mysqld.cnf

Before:

 bind-address = 127.0.0.1 

After:

 # bind-address = 127.0.0.1 # comment out bind-address to test remote access 

Make sure your user can access from the remote host. Sudo mysql -u root -p Enter the password, then enter the command

 mysql> SELECT user,authentication_string,plugin,host FROM mysql.user; 

+ ------------------ + ------------------------------ ------------- + ----------------------- + ------------ - + | user | authentication string | plugin | host | + ------------------ + ------------------------------ ------------- + ----------------------- + ------------ - +

| new user | * 9ACA980716AE084BCA56C59D19F3CEB7BB87B139 | mysql_native_password | 192.168.xx | | new user | * 9ACA980716AE084BCA56C59D19F3CEB7BB87B139 | mysql_native_password | local host |

It works for me, good luck.

+2
source

For those who host MySQL on Raspberry Pi 3, the file you are looking for is located in

 etc/mysql/mariadb.conf.d/50-server.cnf 

You still need to follow the previous steps as above, though, while commenting

 bind-address = 127.0.0.1 

Hope this helps someone spend as much time as I spent on what seemed like a missing line.

+1
source

The following worked for me.

  SELECT User, Host FROM mysql.user; UPDATE mysql.user SET HOST='%' WHERE User='root'; UPDATE mysql.user SET HOST='%' WHERE User='administrator'; FLUSH PRIVILEGES; 

Then

 sudo gedit /etc/mysql/mysql.conf.d/mysqld.cnf 

Edit

 bind-address = 127.0.0.1 to: #bind-address = 127.0.0.1 

save the file. restart the server / restart MySQL

0
source

All Articles