MySQL fails to start

Banana Pup

Well-known member
I just added 2 Samsung SSD 120GB drives in RAID-1 to my dedicated server. I want to move MySQL to it but MySQL is failing to restart.

I did the following:

sudo mkdir /SSD/mysql
chown -R mysql:mysql /SSD/mysql
sudo cp -R /var/lib/mysql/* /SSD/mysql

opened /etc/my.cnf and since datadir didn't exist in the file I added
datadir = /SSD/mysql

restarting MySQL fails, only way to get it to start is to comment out datadir.


Active member
Do you get any meaningful errors? Do you have InnoDB stuff set correctly? It has its own directives for sourcing data.

Banana Pup

Well-known member
It's cPanel/WHM, just got the server. my.cnf doesn't have any InnoDB settings in it.

All it has so far..

key_buffer = 384M
max_allowed_packet = 1M
max_connections = 500
max_user_connections = 35
table_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size = 32M
thread_concurrency = 8
server-id      = 1
max_allowed_packet = 16M
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M
Only error I get is..

root@fla2 [/]# service mysql restart
MySQL manager or server PID file could not be found! [FAILED]
Starting MySQL.Manager of pid-file quit without updating fi[FAILED]

Without the datadir, I still get a PID error, but server starts..

root@fla2 [/]# service mysql restart
MySQL manager or server PID file could not be found! [FAILED]
Starting MySQL. [ OK ]


Well-known member
sudo cp -R /var/lib/mysql/* /SSD/mysql
For starters, you need to use an elevated cp (not just cp), if you want to copy data recursively:
# /bin/cp -pr /var/lib/mysql/* /SSD/mysql/
Second, you should manually recreate your mysql structure and then import your database dumps. The copy command is useful if your databases store only MyISAM tables, which I'm pretty sure is not the case. Also, I would use mydumper to perform backups/restores in MySQL.

Banana Pup

Well-known member
Thanks for the tip Floren.

As for using a symlink, wouldn't that defeat the purpose of using SSD over SATA as the databases would still process though the SATA drives?