Answer the question
In order to leave comments, you need to log in
Error starting MariaDB after migrating datadir from HDD to SSD. What can be wrong?
Hello gentlemen. Debian Jessie is configured with Nginx + PHP7-FPM + MariaDB. I decided to try to transfer the database from a regular HDD to an SSD:
1. I stop MariaDB: systemctl stop mysql
2. I copy the database to the SSD: 3. I change the value of the datadirrsync -av /var/lib/mysql /home/ssd
parameter in the /etc/mysql/my.cnf file from /var/lib/mysql to /home/ssd /mysql
4. Trying to start MariaDB:
and getting the error:systemctl start mysql
Job for mariadb.service failed. See 'systemctl status mariadb.service' and 'journalctl -xn' for details.
-- Logs begin at Wed 2016-12-07 13:44:53 MSK, end at Sat 2016-12-10 14:33:43 MSK. --
Dec 10 14:33:40 hostname systemd[1]: Starting MariaDB database server...
-- Subject: Starting mariadb.service unit
-- Defined-By: systemd
-- Support: lists.freedesktop.org/mailman /listinfo/systemd-devel
--
-- The process of starting the mariadb.service unit has begun.
Dec 10 14:33:41 hostname mysqld[28833]: 2016-12-10 14:33:41 140252996253632 [Note] /usr/sbin/mysqld (mysqld 10.1.19-MariaDB-1~jessie) starting as process 28833 . ..
Dec 10 14:33:41 hostname mysqld[28833]: 2016-12-10 14:33:41 140252996253632 [Warning] Can't create test file /home/ssd/mysql/hostname.lower-test
Dec 10 14 :33:41 hostname mysqld[28833]: [91B blob data]
Dec 10 14:33:41 hostname mysqld[28833]: 2016-12-10 14:33:41 140252996253632 [ERROR] Aborting
Dec 10 14:33:41 hostname systemd[1]: mariadb.service: main process exited, code =exited, status=1/FAILURE
Dec 10 2:33:41 pm hostname systemd[1]: Failed to start MariaDB database server.
-- Subject: mariadb.service unit failed
-- Defined-By: systemd
-- Support: lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- The mariadb.service unit failed.
--
-- Result: failed.
Dec 10 14:33:41 hostname systemd[1]: Unit mariadb.service entered failed state.
Answer the question
In order to leave comments, you need to log in
Mount ssd to another directory NOT /home, mysql service is protected to run in /home.
Or you can bind the directory and not touch the configs:
mount --bind /home/ssd/mysql /var/lib/mysql
I had the same problem, Yandex issued a topic in stack overflow that helped me
There was the same problem but with MYSQL,
1. Check that the rights are correct and the user is in the new folder
2. If it doesn’t help, then leave the config as it was, and make the folder a symlink on ssd
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question