Create databases and use phpMyAdmin
Most dynamic websites, including WordPress, store their content in a database. Sheernox hosting includes MariaDB, which works with software built for MySQL, and PostgreSQL for applications that support it. WordPress uses MariaDB. The phpMyAdmin steps below apply to MariaDB only.
Create a database
Section titled “Create a database”Open Websites, select the website and select Databases in its navigation bar.
-
Select Add database marker 1.
-
Enter a name in Database name marker 1. Every name starts with a prefix based on the website, which you cannot change. The full name, prefix included, is the one your application needs.
-
Give a user access to the database. If the website already has database users, they are listed under Add database user: tick one marker 2 to give it access. To make a new one, select Create new user marker 3:
- Enter a Username (it gets the same prefix) and a Password. The password needs at least 10 characters, with a lowercase letter, an uppercase letter, a number and a special character. Save it in your password manager.
- Leave All database privileges selected unless you need to limit what the user can do.
-
Select Add marker 4.
To add a user later, select Add user on the Databases page, or open the database and use Add database user.
Connect your application
Section titled “Connect your application”Your application needs four values: the database name, the username, the password and the database host. For WordPress and other PHP software on the same website, the host is localhost.
To see every connection option, select the database’s menu button marker 4, then Manage.
Connection info marker 1 shows the socket path for applications that connect through a Unix socket, and an address for applications that need a TCP connection.
Open phpMyAdmin
Section titled “Open phpMyAdmin”phpMyAdmin is a browser tool for looking at and editing your data. It opens in a new tab, already signed in to the database.
- On the Databases page, select the phpMyAdmin button marker 3 on the database’s row, or
- on the database’s Manage page, select PhpMyAdmin marker 2.
The website’s overview also has phpMyAdmin in Quick links.
Import or export a database
Section titled “Import or export a database”On the database’s Manage page:
- Export SQL file: select Download to save the whole database as a
.sql.gzfile. Do this before major changes. - Import SQL file: select Upload and choose a
.sqlfile, or one compressed as.gzor.zip. The page shows the largest file you can upload.
phpMyAdmin also has Export and Import tabs if you want to export only some tables.
Delete a database
Section titled “Delete a database”Select the database’s menu button marker 4, then Delete, and confirm. The data is gone unless you have an export or a backup.
Create a PostgreSQL database
Section titled “Create a PostgreSQL database”PostgreSQL is included on every Shared, Business, WordPress and Reseller Hosting plan. Its database allowance is separate from MariaDB and has the same limit. Shared Essential, Plus, Pro and Ultra include 10, 25, 75 and 150 databases of each type, respectively. WP Launch, Elevate and Scale include 5, 15 and 40 of each type, respectively. Business Core, Plus and Ultra include 100, 250 and 500 of each type, respectively. Reseller plans include unlimited databases of both types within their storage and resource allocation.
- Open Websites in the left sidebar and select your website.
- Select Databases in the top navigation, then Add database and enter the database name.
- Complete the Add database user form to create a new user, or select an existing database user. Save any new credentials securely. For PostgreSQL, All database privileges cannot be deselected.
- Select Add to finish.
When you create the website’s first PostgreSQL database, Enhance creates a PostgreSQL role matching the website’s system username. This role owns all PostgreSQL databases created under that website. Over website SSH, use psql to manage them with the owner credentials stored in .pgpass in the website’s home directory. Keep this file private.
Enhance turns on the PHP pgsql and pdo_pgsql extensions when you create a PostgreSQL database. Select the PostgreSQL driver in your application’s configuration. phpMyAdmin manages MariaDB, not PostgreSQL. If you need help connecting, contact support with the website and error message, without sending your password.
Enhance backups include PostgreSQL databases.