Deploy and Connect MySQL Server
Deploy And Connect MySQL Server
In this article, I’ll talk about how to deploy MySQL service on a remote Windows server, and then how to connect it locally via Navicat.
Step.1 Download MySQL
You can download MySQL community server installer here. Web installer is not recommended since the remote server has relatively low performance.
After you downloaded it, just copy it to the remote server.
Step.2 Install MySQL Server
Now, in your Windows server, launch MySQL installer.
Notice that it may take quite a long time due to the low performance of the remote server. So, just be patient.
Below are some important steps during installation.
Choosing a Setup Type
In this step, select custom, since we only need a minimum part of it.
Select Products
The remote server only stores the database, so here we can choose only the MySQL server.
I’ve already installed it, so they turned grey. :P Just select the latest one, and click the right arrow to add it to products to be installed. Then, click next to continue.
Product Configuration
In the Type and Networking panel, you can optionally change the type from Development Computer to Server, since it is really installed on a server computer.
Then, you can just follow the default configuration to the end.
Just make sure you remember the root password!
Step.3 Configure MySQL
First, we need to add it to the system path.
By default, MySQL is installed at C:\Program Files\MySQL\MySQL Server 8.0\bin
. Just add this path to the system Path
variable.
Then, we need configure MySQL server to make it accessible at out local machine. Open cmd
on the server, and execute the following commands.
Reference: https://developer.aliyun.com/article/801237
1 | C:\Users\Administrator>mysql -u root -p |
You are all done if Host
of root
is set to %
.
Step.4 Update Firewall
Remember to open port 3306 (default port of MySQL) of your remote server.
Step.5 Connect MySQL
In Navicat, create a new MySQL connection. Then, in the configuration panel, enter the host name of your remote server and the root password.
Tada! You successfully connected to your MySQL server! Congratulations!
Troubleshoot
Why MySQL service could not be started?
I don’t know either… MySQL service will automatically start after installation, but if you shut it down, it might not start again properly… :(
So, you can choose to uninstall and then reinstall the server in the MySQL installer. (You can choose not to uninstall the installer.)