Mysql – Can’t connect to MySQL from remote computer

linuxMySQL

A MySQL Server is newly installed on linux computer LPNBUNTU.

On local linux I can get a DB-connection and I was finally able to set a root password.

When connected I get

MYSQL>status
root@localhost

I rather think MySQL should be aware on that computer it is installed. Thus I guess the user should be root@LPNBUNTU. Just an idea.

I open the port 3306 on linux
sudo ufw allow 3306

My problem is, I can't connect from my Window-10 computer via mysqlsh. I think should doing this like

mySQL\SQL>
 \connect --mysql root@lpnbuntu:3306
Creating a Classic session to 'root@lpnbuntu:3306'
Please provide the password for 'root@lpnbuntu:3306': *********
after some timeout I get 
MySQL Error 2003 (HY000): Can't connect to MySQL server on 'lpnbuntu' (10061)

I guess the MYSQLServer should be made aware, that it on computer lpnbuntu, and should react to all connection request addresses from any computer on port lpnbuntu:3306.

How can I make this happen?

Best Answer

I believe this can be resolved by setting the "bind-address " to 0.0.0.0 or the specific IP address of your win-10 computer.

this is done by accessing the MySQL config file and physically typing in the desired ip.

the file path is usually:

/etc/mysql/my.cnf

0.0.0.0 will allow access from all networks.