Databases – MySQL Questions
MySQL database support: if your website uses a MySQL database, here's where you need to look if you have any questions about it.
Building a MySQL instance on CentOS 7
You might need a larger database - for large ecommerce stores or complex sites, for example. To do this, you can configure a CentOS 7 VPS as a MySQL instance on an Unmanaged virtual private server.
This guide will show you how to build a MySQL instance using a 20i VPS.
Step 1 - Install MariaDB
You'll first need to install MariaDB - here's a guide: https://www.tecmint.com/install-mariadb-in-centos-7/
Once you've installed MariaDB you can test the installation by running the following:
[root@vps-b92a95 ~]# mysql -V
Which should give you:
mysql Ver 15.1 Distrib 10.1.44-MariaDB, for Linux (x86_64) using readline 5.1
Step 2 - Access MySQL
You can access MySQL with:
[root@vps-b92a95 /]# mysql -u root -p
You will then be prompted for the password, set when following the guide above. It might be easier to use the VPS password for convenience at this stage.
Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 15 Server version: 10.1.44-MariaDB MariaDB Server Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]>
Step 3 - Create the database
So now that MariaDB is installed, you will want to create the databases and database users within MariaDB.
To create a database:
[root@vps-b92a95 ~]# create database DATABASE_NAME;
If the site is to be hosted on the shared platform and the database is to be hosted on the VPS, you should create a user with remote access privileges.
So in this format:
[root@vps-b92a95 ~]# create user 'DATABASE_USER'@'%' identified by 'PASSWORD';
For example:
[root@vps-b92a95 ~]# create user 'wordpress_user'@'%' identified by 'password123!';
Now that the user and databases are created, you will want to grant all privileges.
[root@vps-b92a95 ~]# grant all privileges on DATABASE_NAME.* TO 'USER_NAME'@'%';
For example:
[root@vps-b92a95 ~]# grant all privileges on wordpress_testing.* TO 'wordpress_user'@'%';
Then let the privileges take effect:
[root@vps-b92a95 ~]# flush privileges;
You can check to see if the users and databases are accessible:
[root@vps-b92a95 /]# mysql -u wordpress_user -p wordpress_testing Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 18 Server version: 10.1.44-MariaDB MariaDB Server Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [wordpress_testing]>
Step 4 - Upload the .SQL file
Once you're happy with the database and user access, you can now look at uploading the database file to the server. You can use WinSCP if you're a Windows user. When the file is uploaded, you'll need to import the file:
[root@vps-b92a95 ~]# mysql -u DATABASE_USERNAME -p DATABASE < importedfile.sql
For example:
[root@vps-b92a95 ~]# mysql -u wordpress_user -p wordpress_testing < wordpress-3132333666.sql
Now that the database is imported you should open the firewall for the incoming MariaDB connections:
[root@vps-b92a95 ~]# firewall-cmd --permanent --add-service=mysql && firewall-cmd --reload
Conclusion
So that's the server all set up and ready. You would need to update the configuration file to connect to the database on the VPS, and you should be good to go.
Austin B.What's the maximum MySQL database size allowed?
At 20i, each MySQL database you create can store up to 1024 MB (1 GB) of data. As databases comprise of only text, this is a lot of space in real terms; to put it into perspective, a 20i customer’s average database size is just 10 MB.
In the rare event that you need more than 1024 MB, you'll need to add an additional database. You aren't able to add more MySQL databases to websites hosted on our WordPress hosting platform; you will need to complete a Platform Transfer first.
If you have a Home, Business, or Reseller Hosting package with us, there’s no limit to the number of additional databases you can add. If you have a Starter Hosting package, you are limited to one MySQL database but you can upgrade your hosting package through My20i, or purchase an additional hosting plan.
For a step-by-step guide on creating new MySQL databases, please see the following article: How do I create a MySQL database in My20i.
While 1024 MB is enough storage for the majority of databases you may occasionally need a larger one. If you do need to host a database larger than this that can be done using a Managed Hosting on a VPS.
Austin B.How do I create a MySQL database in My20i?
You can create MySQL databases in seconds directly from your My20i control panel.
This option is unavailable for packages hosted on our WordPress platform due to its WP-optimised nature. If you need to create a MySQL database, you'll need to carry out a Platform Transfer to move the website to our Linux Web Hosting platform.
Starter Hosting packages are limited to one MySQL database. For more databases, you can upgrade your hosting package through My20i, or purchase an additional hosting plan.
To create new MySQL databases:
1. Log in to My20i and select Manage Hosting.
2. Choose Manage next to the hosting package you wish to create a MySQL database for.
3. Under Web Tools, select MySQL Databases. Here you can complete the following actions:
- Create new MySQL databases. Each MySQL database has a maximum size of 1024MB (1GB).
- Manage existing databases.
- Add additional MySQL users to databases.
- Manage your additional MySQL users.
4. Under Add a new MySQL Database, choose a name for your database. Database names must be between 6 and 20 characters long, and we automatically add a suffix to avoid name collisions with other users.
5. Once you have chosen a name, click Create Database. Your new MySQL database will automatically appear in the Manage MySQL Databases section underneath.
From here you can change the automatically generated password, monitor usage, remove your MySQL database, or log in to your database.
Austin B.How do I check MySQL Database sizes across packages in My20i?
20i provides an easy way to monitor and view all MySQL database sizes across all packages in your My20i account.
To access the MySQL Database Size Reports:
- Login to My20i.
- Head to the Reporting section on the home page and select MySQL Database Sizes.

You’ll see a full list of all the databases under your 20i account and their sizes. You’re also shown which domain they are associated-with so that you can manage the MySQL database, should you need-to.
Austin B.
Lloyd Cobb
Chris Wright
Joshua Rosato
Andrew Porter
Josh Sargent
Jordan Graves
