1

The current partition of mine mysql databases is full so it denies to start. How can i move databases to another partition without losing anything.

Edit: I am on Ubuntu 10 Server.

Thanks

1
  • Before doing any of that do a mysql backup - just in case and move that backed up file out of the way. Always backup b4 touching the production. Jun 19, 2010 at 0:44

1 Answer 1

7

As root:

  1. Cleanly shut down MySQL (myqsladmin shutdown)
  2. Edit /etc/my.cnf and set the data-dir configuration option to the new location of your MySQL data directory.
  3. Move your entire data directory to the new location, ie: mv /var/lib/mysql/* /mnt/mysql/
  4. Ensure permissions are correct, chown -R mysql:mysql /mnt/mysql
  5. Start MySQL as usual.
2
  • Remember to do these operations as root.
    – lg.
    Jun 18, 2010 at 15:49
  • You rules, works awesomely :D
    – user44520
    Jun 18, 2010 at 16:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .