Problem after moving mysql database
Posted on 2014-10-27
When the IT dept set up my Linux server with MySQL they set the data directory to /var/lib/mysql
Now the system disk is full.
So there is a disk with loads of space which i have copied of the database to using:
cp /var/lib/mysql /data
then i edited the my.cnf file and changed the row that Points to the database to:
datadir = /data
I deleted some old log files to create some space.
Then i restarted the server.
But i now get an error message in mysqld.log that says:
Fatal error: Can’t open and lock privilege tables: Table ‘mysql.host’ doesn’t exist
How can i solve this? I have seen examples that say you can use:
mysql_install_db –user=mysql –ldata=/newlocation
but i just want to be certain i am not doing a total new install by type in that command.
I know nothing about Linux/MySQL so keep you answers to beginner level!