I was trying to move my database to a larger partition according to this guide.

My partition exists on /mdb/mysql-data, but when I edit the my.cnf file, it loads the old configuration on my.cnf.d/mariadb-server.cnf.

Here's what I did:

  1. I tried to comment the old ones but it won't run.
  2. Run MariaDB with both configs: mysql.sock is on /var/lib/mysql
  3. Moved my old directory by mv /var/lib/mysql var/lib/mysql.bak

Here's my current .cnf


My error after 3:

enter image description here Why wont my socket generate on /mdb/mysql-data/?

  • Can you show the permission/ownership of /mdb/mysql-data? Does /mdb have chmod a+x permissions active? Does journalctl -n 50 -u mariadb.service show more detailed results of the the mysql-prepare-db-dir failure? Did you copy the data directory over to /mdb/mysql-data while it was shutdown? – danblack Jul 21 '20 at 22:50
  • Oh, this one's fixed, I just needed to run the following commands: $ sudo semanage fcontext -a -t mysql_db_t “/mdb/mysql-data(/.*)?” $ sudo restorecon -R /mdb/mysql-data It was some SELinux stuff – Gwynn Jul 22 '20 at 0:10
  • 1
    Like was what is written in the guide you followed :-) – danblack Jul 22 '20 at 3:55
  • Yeah, I didn't really read it thoroughly and missed it. It's a bad habit of mine. But I already made notes about how to do stuff properly. – Gwynn Jul 22 '20 at 16:43
  • 1
    Fix your habit of sloppiness quickly. Databases and the people that depend on them get rather unpleasant when simple sloppy mistakes cause outages for hours/days. – danblack Jul 23 '20 at 0:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.