Check out our How to Setup a WordPress MySQL Database in the Cloud blog post to learn more about the advantages of using ScaleGrid.
- Sign up for a free 30-day trial on the ScaleGrid console.
- Create a new MySQL deployment in a few easy steps from our Getting Started page. Make sure to create it in a region that matches your WordPress deployment region. We support six different MySQL DBaaS plans on AWS, Azure, GCP, OCI, Linode and DigitalOcean.
- In the create wizard that pops up, customize your plan details, replica setup, security, and firewall rules to create your new MySQL deployment at ScaleGrid. Follow the links above in the yellow box for detailed instructions on creating your cluster under each plan.
While setting up your WordPress site, you will be asked to supply the hostname, database name and user credentials for your MySQL database. Here’s how you can set this up:
- Go to your MySQL cluster list page, and select your newly created cluster.
- Select the ‘Databases’ tab, and click the green ‘New Database’ button.
- In the ‘Create a new database’ window that pops up, simply enter a name for your database, for example, ‘wordpress_database’, and click ‘Create’.
Check out our Create a MySQL Database doc for more instructions.
- Select the ‘Users‘ tab on your MySQL cluster details page, and click the ‘New User’ button.
- Select the new ‘wordpress_database’ that you just created from the dropdown field as the database for this user.
- In the ‘New User’ window that comes up, enter a name and password for the new user, for example, ‘wpuser’.
- Lastly, select ‘Read-Write’ as the ‘Role’ for this new user:
- Click ‘Create’ and your new user will be created! Make note of your database name, username, and password which you’ll need for your WordPress installation.
Check out our Create a MySQL Database User doc for more instructions.
- Go to your MySQL Cluster Details page and select the ‘Overview’ tab.
- Find the Command Line Syntax section at the bottom of the page to see the command that can be used to connect your MySQL deployment through MySQL client.
- The server name following the ‘-h’ option is the hostname of your MySQL deployment, and in this particular case, it is ‘SG-help-1-master.devservers.scalegrid.io’.
Before you begin configuring your WordPress installation, we recommend checking the connectivity between your WordPress server and MySQL deployment.
In order to check your MySQL WordPress connectivity, you will need a MySQL client on your server. Follow these instructions to download and install MySQL client if not already installed. Execute the following from the command line of your WordPress server and make sure you are able to connect:
mysql -u wpuser -h SG-help-1-master.devservers.scalegrid.io -p<Your Password>
If you’ve enabled SSL for your MySQL server, make sure that you see the ‘Cipher in use’ output for the SSL field as shown below:
mysql Ver 14.14 Distrib 5.7.15, for Win64 (x86_64)
Connection id: 79854
Current user: wpuser@xxxx
SSL: Cipher in use is DHE-RSA-AES256-SHA
Using delimiter: ;
Server version: 5.7.21-log MySQL Community Server (GPL)
Protocol version: 10
During your WordPress installation, you will be asked to specify your MySQL database details. Now that you’ve created a new MySQL deployment, database, user, and found your hostname, you can enter these details here to connect:
Once you submit, your WordPress installation should go through and be able to connect with your MySQL deployment hosted on ScaleGrid.
If you have enabled SSL for your MySQL deployment, then your WordPress installation requires an additional setting that cannot be specified through the UI above. In such cases, before installing WordPress, you will have to edit a file called wp-config-sample.php and save it as wp-config.php.
You can follow detailed instructions here on editing your wp-config.php file. The sample below shows the MySQL section in the wp-config.php file, and the last line in this section indicates that MySQL has been configured with SSL:
Once you complete the installation, you will see that your WordPress site is up and running using ScaleGrid’s MySQL hosting as its database!
Updated over 1 year ago