How to move mysql database to another mount point

I have a MySQL database, it’s getting bigger and bigger, and I want to move the whole database to another mount point, where I have enough memory. I want my current data to be transferred, and that the new data will be saved in a new position.

software stack: MySQL 5 runs on FreeBSD 6

+3
source share
3 answers

Of course, the other answers are valid. But if you want to keep the default configuration, follow these steps:

  • stop mysqld
  • mv /var/lib/mysql /var/lib/mysql.backup
  • set a new partition under /var/lib/mysql
  • cp -r /var/lib/mysql.backup /var/lib/mysql
  • run mysqld
+1
source
  • Stop mysqld
  • /var/lib/mysql ( $datadir my.cnf )
  • $datadir, MySQL my.cnf, .
  • mysqld

.;) , MySQL.

+3

:

  • MySQL
  • rsync
  • :
    • mysql.conf, MySQL, ,
  • MySQL
+2

Source: https://habr.com/ru/post/1706318/


All Articles