Every WordPress website uses a database to store important information, including posts, pages, users, settings, and other website data.
10Web uses MySQL to manage website databases and provides access through phpMyAdmin, a browser-based database management tool.
In this guide, you'll learn how to:
- Access your website's database
- Run SQL queries using phpMyAdmin
- Import an SQL file using phpMyAdmin or SSH
- Understand database management options and limitations
Note:
Database access is available for websites hosted on eligible paid 10Web plans. Database management tools are not available on the Free plan.
How to access your website database
You can access your website's MySQL database directly from your 10Web dashboard using phpMyAdmin.
- Log in to your 10Web dashboard.
- Click Manage on the website you want to access.
- Expand Advanced in the left menu.
- Under Hosting services, select Credentials.
- Locate the Database Access section.
- Click Open MySQL to launch phpMyAdmin.
- Copy the database username and password from the Credentials page and enter them into phpMyAdmin.
- Click Go to log in.
Once logged in, you can view your database tables and perform database management operations.
Interactive video tutorial
Quick tip:
You can also access your database using SSH if you're comfortable working with command-line tools.
How to run an SQL query in phpMyAdmin
SQL (Structured Query Language) allows you to retrieve, update, and manage data stored in your website's database.
To run an SQL query:
- Access phpMyAdmin using the instructions above.
- Select your website's database from the left sidebar.
- Click the SQL tab at the top.
- Enter your SQL query in the editor.
- Click Go to execute the query.
For example, to view the contents of your WordPress posts table, you can use:
SELECT * FROM wp_posts;
Note:
WordPress table prefixes may differ between websites. If your database uses a prefix other than wp_, replace it with the prefix shown in phpMyAdmin.
Important:
Before executing queries that modify or delete data, such as UPDATE, INSERT, or DELETE, create a backup of your website. Incorrect SQL queries can permanently change or remove website data.
Running queries on a staging website
Staging environments have separate databases and credentials.
To run a query on your staging website, switch to the staging environment in your 10Web dashboard, open its database credentials, and follow the same steps.
Quick tip:
When testing queries that modify website data, use your staging environment first to avoid affecting your live website.
How to import an SQL file into your database
You may need to import an SQL file when restoring database content, migrating data, or transferring information between environments.
10Web supports two methods for importing SQL files:
- phpMyAdmin: Recommended for smaller SQL files and straightforward imports.
- SSH and SFTP: An alternative for larger files or imports that cannot be completed through phpMyAdmin.
Important:
Importing an SQL file can overwrite or modify existing database content. Create a backup before importing and verify that the SQL file is intended for the selected database.
Method 1: Import using phpMyAdmin
- Open phpMyAdmin from your 10Web dashboard.
- Select the database where you want to import the SQL file.
- Click the Import tab.
- Under File to import, click Choose File.
- Select the SQL file from your computer.
- Click Go to start the import.
Once the import is complete, phpMyAdmin will display a confirmation message. Check the database tables to verify that the import was successful.
Note:
If the import fails because of the file size or an execution timeout, try importing the file using SSH and SFTP instead.
Method 2: Import using SSH and SFTP
For larger SQL files, you can upload the file to your hosting environment and import it using the command line.
Step 1: Upload your SQL file using SFTP
- Open an SFTP client, such as FileZilla.
- Connect to your website using the SFTP credentials available in your 10Web dashboard.
- Navigate to your website's directory. For standard live WordPress installations, the documented path is
/home/wplive/web/wp-live/. - Upload your SQL file, for example,
example.sql.
Step 2: Import the file using SSH
- Connect to your website's server using SSH.
- Run the following command, replacing the placeholders with your database information:
mysql -u MYSQL_USERNAME -h mysql.10web.site --binary-mode MYSQL_DB_NAME < /home/wplive/web/wp-live/example.sql
Replace:
- MYSQL_USERNAME: Your database username.
- MYSQL_DB_NAME: Your database name.
- example.sql: The actual name of your SQL file.
You can find your database connection information in your website's wp-config.php file or the available database credentials.
Important:
Make sure you're importing into the correct database. Confirm the SQL file location, database credentials, and command syntax before running the import. If the documented server path or host differs for your environment, use the actual values assigned to your website.
Frequently asked questions
Can I create an additional database for my website?
10Web automatically creates a MySQL database when your WordPress website is provisioned.
If your project requires an additional independent database, contact our Customer Care team to check whether your hosting configuration can support the request.
Can a single website use multiple databases?
A standard WordPress installation uses one primary database. Some custom applications or advanced WordPress configurations may require additional database connections.
If you need multiple databases for a single website, contact Customer Care to discuss your requirements and available hosting options.
Where can I find my database credentials?
Open your website in the 10Web dashboard and navigate to Advanced → Hosting services → Credentials → Database Access.
Does my staging website use the same database as my live website?
No. Live and staging environments have separate databases and database credentials. Make sure you're working in the correct environment before making changes.