How to connect your desktop database manager to a VMware Player MySQL database

This article shows how you can access a MySQL database server installed in a VMware Player running Debian (or any other Linux)  with your favorite desktop database manager like Navicat, MySQL Workbench or HeidiSQL.

Avoid the 10061 connection errors and follow this easy walk through.

Sample configuration

image

With the command ipconfig /all which can be executed from the prompt you will see that the VMware Player has configured additional virtual network adapters to your network configuration.

The IP address 192.168.101.1 has been assigned to your PC by VMware Player to the virtual ethernet adapter. It is a 1-on-1 connection, for by default the network connection is NAT. So your PC is the only one that can “see” your VMware Player installed server.

As we can see is the IP address given to my “workstation” by VMware is: 192.168.101.1 (Depends on how you have configured your webserver’s IP address).

The IP address of the webserver is in our example: 192.168.101.101.

Connecting to the MySQL server

image

As you might have found out by now, you can’t connect to your MySQL server by default without getting the infamous 10061 connection errors. First we have to create a privilege in the MySQL server to grant access for your IP address. I am doing this with MySQL Workbench from Oracle (free software). I don’t like to work with prompt commands that much.

Go to the main panel of the Workbench and select Manage Securities and select your server instance.

image

Now click in  the user panel on the Add account button. Now enter the fields as below (choose your own user and password and put in the Limit connectivity to host the local IP address of the VMware virtual adapter (this example: 192.168.101.1).

image

Now click on the Administrative Roles tab and change the priviliges of this user. If you use it as a test server for your own purposes, you can grant it all the rights.

image

Now click on Apply and restart the database server by selecting Startup/Shutdown from the left panel.

image

Now press the Stop Server button and after that press the Start Server button to restart the database server.

image

Configuring Navicat (or any other desktop database client)

This goes the usual way. Don’t forget to put the right IP address in the Host Name/IP Address and the proper User Name and Password. After that the result should look like below:

image

Links

Comments

  1. TC says

    I still get the same error. I have checked firewall settings to see if that would make a difference. I have used my actual VM IP to try to connect and the virtual ethernet card ip in windows, but it still doesn’t work.

  2. TC says

    I figured out my problem Mariadb is now set by default to only listen on 127.0.0.1.

    I works great now that I changed the config file and restarted the server.

Leave a Reply

Your email address will not be published. Required fields are marked *