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

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

This article shows a walk through on how to connect your favorite database manager to a MySQL database in VMWare Player.

In this article I will show 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

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.

Ethernet adapter Local Area Connection 3:

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : VMware Virtual Ethernet Adapter for VMnet
8
   Physical Address. . . . . . . . . : 00-50-56-C0-00-08
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes
   Link-local IPv6 Address . . . . . : fe80::b5db:acef:aded:d9b1%24(Preferred)
   IPv4 Address. . . . . . . . . . . : 192.168.101.1(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . :
   DHCPv6 IAID . . . . . . . . . . . : 754995286
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-17-8E-73-4A-00-26-C7-9A-1F-FE

   DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
                                       fec0:0:0:ffff::2%1
                                       fec0:0:0:ffff::3%1
   NetBIOS over Tcpip. . . . . . . . : Enabled

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

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.

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).

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.

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

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

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:

Links

No comments yet

your email address will not be published. required fields are marked *