As far as the VM and Windows itself is concerned, the server is just another real PC on the same network. I want to use a graphical interface to set up databases and tables and everything. Now I’m trying to set up MySQL to allow remote access, which is how I ended up here. I got Windows to access the server I created a “test.php” file with a simple echo command to test if it would behave as expected and it did. The VM is running the server stuff (duh) but I’m using the host machine (Windows 10) to do the testing. I finally managed to get most of it set up. I’m trying to set up a development LAMP server in a virtual machine. Just remember to include their respective IP addresses.Īlternatively, you can allow connections to your MySQL database from any IP address with the following command: If you need to access the database from other machines in the future, you can grant them access on an ad hoc basis with this command.
If you only plan to access the database server from one specific machine, you can grant that machine exclusive permission to connect to the database remotely with the following command. Lastly, assuming you’ve configured a firewall on your database server, you will also need to open port 3306 - MySQL’s default port - to allow traffic to MySQL.
This will free up any memory that the server cached as a result of the preceding CREATE USER and GRANT statements:
If you’ve enabled password authentication for root, you will need to use the following command to access the MySQL shell instead: To do so, open up the MySQL client as your root MySQL user or with another privileged user account: If you have an existing MySQL user account which you plan to use to connect to the database from your remote host, you’ll need to reconfigure that account to connect from the remote server instead of localhost. Then restart the MySQL service to put the changes you made to mysqld.cnf into effect: After changing this line, save and close the file ( CTRL + X, Y, then ENTER if you edited it with nano).