- Home
-
Store
- Browse All
- SHARED HOSTING
- VPS SERVER
- DEDICATED SERVER
- DATABSE HOSTING
- RESELLER HOSTING
- EMAIL HOSTING
- FTP HOSTING
- Hosting Addons
- SSL Certificates
- Weebly Website Builder
- SiteLock
- Email Spam Filtering
- CodeGuard
- SSL Certificates
- Website Builder
- Website Security
- E-mail Services
- Website Backup
- SEO Tools
- Site Builder
- VPN
- Professional Email
- XOVI NOW
- Register a New Domain
- Transfer Domains to Us
- Announcements
- Knowledgebase
- Network Status
- Contact Us
-
More
Categories
Categories
Tag Cloud
How to move WHM MySQL data directory Print
- How to move WHM MySQL data directory
- 0
Additionally, please always create a full mysqldump before ever doing something like this as well as stopping Service Manager > MySQL monitor option, since that will restart MySQL after you've stopped it and while you are moving it. The better steps are these:
1. Make a full mysqldump file:
mysqldump --all-databases | gzip > /home/alldatabases.sql.gz
2. Uncheck monitor in WHM > Service Manager for Mysql and save the area
3. Stop MySQL
/etc/init.d/mysql stop
4. Make the directory for MySQL in /home, move it and symlink it:
mkdir /home/var_mysql
mv /var/lib/mysql /home/var_mysql
chown -R mysql:mysql /home/var_mysql/mysql
ln -s /home/var_mysql/mysql /var/lib/mysql
/etc/init.d/mysql start
5. Re-check monitor in WHM > Service Manager for MySQL and save the area
If anything goes wrong, you have the full mysqldump backup, and can use these steps to restore from it:
First, you'll need the MySQL root password:
cat /root/.my.cnf
Once you have the password, then you can use this command to restore from that file:
gunzip < /home/alldatabases.sql.gz | mysql -u root -p
You'll be asked for the password here, so simply enter the one noted in /root/.my.cnf location.