MariaDB / MySQL Database Administration
This section contains articles and resources for MySQL administration. The topics covered include initial setup, user management, replication, and performance tuning.
Adding MySQL Users to Databases
You can create MySQL users to help you organize your database management, giving each user access to specific databases and specific privileges. You can assign MySQL users to databases and give them permissions using: cPanel or the command line.
Backing Up a MySQL Database
Periodic automatic backups are crucial for website restoration in case of mishaps. While MySQL databases are typically included, manual backups are prudent before significant database or server changes. This preemptive measure ensures the availability of previous versions for restoration if needed.
Batch converting MySQL table engines
MySQL batch table engine conversion: MyISAM InnoDB. Get CLI scripts, rollback prep, & robust methods. *Always backup data first!*
Change a MySQL User Password
Changing MySQL passwords to something new and secure is easy via the command line.
Checking a MySQL Database for Errors and Repairing
To check and repair MySQL database errors in cPanel, navigate to the MySQL Databases section after logging in. From there, you can access the home screen to manage databases and users.
Checking Your MySQL Version
If you are using MySQL databases, you might need to occasionally check the version of MySQL that is installed on your server. It’s easy to check your MySQL version using either cPanel or the command line.
Creating a MySQL User
Control MySQL database access by creating user-specific restrictions for databases, tables, and privileges. Use cPanel or the command line to create MySQL users.
Deleting a MySQL Database
Deleting unused databases frees up space but the action is permanent! We strongly recommend backing up your database before you delete it, just in case.
Deleting MySQL Users
If you are using MySQL databases with multiple users, you may need to control database access by deleting database users. You can delete MySQL users using either cPanel or the command line.
How to connect to MySQL/MariaDB using SQLTools in VSCode
With SQLTools in VSCode, you can streamline your database workflow, making it a valuable tool for developers who interact with MySQL or MariaDB databases regularly.
Importing and exporting a MySQL database
Learn how to export and import MySQL databases for backups. This guide covers using the command line (`mysqldump`), phpMyAdmin, and WP-CLI.
Installing MySQL community edition on new AlmaLinux 8 servers
Install MySQL Community on new AlmaLinux 8. *NEW SERVERS ONLY* (data loss risk). Steps: prep, repo, install, secure.
MariaDB performance tuning tips at Nexcess
Optimize MariaDB performance with our tuning script and expert tips. Learn to use MySQLTuner and benchmarking to get a faster database today.
Moving the MySQL Data Directory
Move MySQL `datadir`: Step-by-step guide using `rsync`, symlinks, & `my.cnf` updates. Includes CloudLinux notes & critical backup advice.
MySQL Commands
MySQL command guide: Data dump/restore, password management, admin tasks (upgrades, root reset, slow log) & datadir/tmpdir setup.
MySQL Performance: Converting MySQL to MariaDB
Converting MySQL to MariaDB is beneficial for optimizing your website and database. In our tutorial, we cover how to upgrade your database on your Ubuntu and CentOS server using cPanel, Plesk and command line.
MySQL Troubleshooting
MySQL troubleshooting guide: Resolve DB corruption, connection problems, full disks, remote access, & advanced errors.
Mysqldump
Use `mysqldump` to backup & restore MySQL/MariaDB. Learn to export DBs/tables, restore from SQL, & fix “trigger in wrong schema” errors.
Mysqldump stored procedures
MySQL Stored Procedures: Check for routines & ensure they’re in `mysqldump` backups using `–routines`. cPanel’s `/scripts/pkgacct` handles this.
Resetting Your MySQL Root Password
Reset MySQL root password if security compromised. Change passwords every 90 days for enhanced server security.
Restoring a MySQL Database from a Backup
Made a change and something went wrong? Restoring a MySQL database from a backup is the fastest way to get your site back online. Here’s how.
Selecting a MySQL Database via Command Line and cPanel
Have multiple MySQL databases? To avoid editing the wrong one, you must select it first. Here’s how to do it using cPanel or the command line.
Show (List) MySQL Databases via Command Line on Linux
Find out how to easily show (list) all MySQL databases on Linux via command line with our comprehensive tutorial.
Understanding key MySQL variables
This guide explains key MySQL variables, their purpose, impact, and default values. It’s a reference for understanding server behavior and optimization, with caution for changes.
Understanding the InnoDB storage engine in MySQL
InnoDB: MySQL/MariaDB’s default engine for performance & reliability. Guide: features, `SHOW ENGINES`, create/alter tables & fix issues.
Upgrading MySQL
Making sure that your server software is up to date is one of the best ways to protect yourself from malicious attacks. This includes updating your database software, like MySQL. MySQL upgrades involve a number of steps, including planning, backups, upgrading binaries, upgrading tables, and cleanup.
Upgrading MySQL on CentOS
This tutorial is for the purpose of upgrading MySQL on an unmanaged server with a CentOS operating system. This tutorial assumes that you are already logged in as root via Secure Shell. Make sure you complete the backup process before making any changes to your MySQL.
Upgrading MySQL on Ubuntu
This tutorial is for the purpose of upgrading MySQL on an unmanaged server with an Ubuntu operating system. If you have CentOS or are upgrading via cPanel, please see our articles for instructions on upgrading via CentOS or WHM.
Upgrading MySQL/MariaDB on core managed servers
Safely upgrade MySQL/MariaDB: Step-by-step guide for Core Managed servers. Includes pre-checks, backups (`rsync`, `mysqldump`), upgrade & follow-up.
Using MySQL Tools via Secure Shell (SSH)
Interacting with MySQL Client via command line allows manipulation of databases and their functions. This article covers common commands and their functionalities, facilitating database management.
What is MySQL Indexing?
Many modern websites rely on databases to store important data. When these databases get large, your server can slow down when there are a lot of requests (queries) that the database has to handle. Speeding these queries up requires knowledge of MySQL indexing.