Skip to main content

mysql appears to be down after moving database

Comments

6 comments

  • cPanelLauren
    IT looks as though something is not recognizing that the datadir was moved. What's present in /etc/my.cnf
    0
  • MjrGaelic
    Thanks for getting back to me. Here is my current cnf.. # # This group is read both both by the client and the server # use it for options that affect everything # [client-server] # # include all files from the config directory # !includedir /etc/my.cnf.d [mysqld] log-error=/var/lib/mysql/ws2.sd50.bc.ca.err performance-schema=0 innodb_file_per_table=1 max_allowed_packet=268435456 open_files_limit=40000 local-infile=0
    0
  • cPanelLauren
    Thanks! Now what's the output of the following? mysql -u root -p -e "SELECT @@datadir;"
    as well as: stat /var/lib/mysql
    0
  • MjrGaelic
    Thanks again =) Enter password: +-----------------+ | @@datadir | +-----------------+ | /var/lib/mysql/ | +-----------------+ [root@ws etc]#
    and.. [root@ws etc]# stat /var/lib/mysql File: "/var/lib/mysql" -> "/home/var_mysql/mysql" Size: 21 Blocks: 0 IO Block: 4096 symbolic link Device: fd00h/64768d Inode: 1027232 Links: 1 Access: (0777/lrwxrwxrwx) Uid: ( 0/ root) Gid: ( 0/ root) Context: system_u:object_r:var_lib_t:s0 Access: 2020-07-14 08:37:31.094000000 -0700 Modify: 2020-07-13 08:36:37.884000000 -0700 Change: 2020-07-13 08:36:37.884000000 -0700 Birth: - [root@ws etc]#
    0
  • cPanelLauren
    This is all as expected. Can you please open a ticket using the link in my signature? Once open please reply with the Ticket ID here so that we can update this thread with the resolution once the ticket is resolved. Thanks!
    0
  • SamuelM
    Hello, Thank you for submitting a ticket. I wanted to follow up here in the forum in case anybody following this thread is curious about the resolution. After moving the MariaDB data directory to /home, it was necessary to disable the ProtectHome option. The following steps are required: 1) Use systemctl edit mariadb
    to create an override file with the following contents: [Service] ProtectHome=false
    2) Manually edit /etc/systemd/system/mariadb.service.d/protecthome.conf to ensure it has the same contents: [Service] ProtectHome=false
    3) Reload the daemon: systemctl daemon-reload
    4) Start the service: /scripts/restartsrv_mysql --start
    I hope you find this information helpful. Thank you again for contacting cPanel!
    0

Please sign in to leave a comment.