Search code examples
mysqlwindows-server-2012mysql-8.0

Unable to Access MySql 8.0 Database from Remote Windows Server


I have Installed MySql 8.0 Version in a windows server and able to connect via WorkBench/MySql shell locally.

I would like to access MySql from a remote windows server.

Here are the things I have tried.

1) Created root@% user and Grant full access to the new user. 2) Created a new user as test@'remoteserveripaddress' and Grant full access to the user. 3) Opened port 3306 on Both Remote and MySql server. 4) Added "bind_address=*" in my.ini file and restarted the MySQL80 Service.

I am running out of options.

Error: I am getting below error

Failed to connect MySql at UserName@hostipaddress:3306 
SSL connection error: error:00000000:lib(0):func(0):reason(0)

No matter how many different ways I try.

Not sure what am I doing wrong ??


Solution

  • Try to execute below command in your terminal :

    mysql -h server -P 3306 -u root -p
    

    If you successfully connect to your database, the same thing has to happen with Mysql Workbench.

    If you are unable to connect then I think 3306 port is acquired by another process.

    Find which process running on 3306 port. If required, give admin privileges using sudo.

    netstat -lnp | grep 3306
    

    Kill/stop that process and restart your MySQL server. You are good to go.

    Execute the below command to find my.cnf file.

    mysql --help | grep cnf
    

    You can change MySQL port to any available port in your system. But after that, make sure you restart MySQL server.