Hi all,
I have an existing mysql database on a disk, and I want to mount the disk in the databases directory and start mysql to get the database back to where it was from a snapshot.
I'm using this script:
/etc/init.d/mysqld stop
mkdir /var/lib/mysql/mydbname/
chown mysql /var/lib/mysql/mydbname/
chgrp mysql /var/lib/mysql/mydbname/
mount /dev/sdg /var/lib/mysql/mydbname/
/etc/init.d/mysqld start
mysql -u root --execute "grant all on mydbname.* to 'username'@'localhost' identified by 'mypassword'"
This seems at first glance to work, but then certain queries fail saying that a particular table does not exist. Running SHOW TABLES does list the table in question so do I presume correctly that the files have become corrupted?
Is it not possible to mount the files on a disk as above? Do I need to run off a dump file every time?
C:\DOS:>
C:\DOS:>RUN
RUN DOS RUN!!
I have an existing mysql database on a disk, and I want to mount the disk in the databases directory and start mysql to get the database back to where it was from a snapshot.
I'm using this script:
/etc/init.d/mysqld stop
mkdir /var/lib/mysql/mydbname/
chown mysql /var/lib/mysql/mydbname/
chgrp mysql /var/lib/mysql/mydbname/
mount /dev/sdg /var/lib/mysql/mydbname/
/etc/init.d/mysqld start
mysql -u root --execute "grant all on mydbname.* to 'username'@'localhost' identified by 'mypassword'"
This seems at first glance to work, but then certain queries fail saying that a particular table does not exist. Running SHOW TABLES does list the table in question so do I presume correctly that the files have become corrupted?
Is it not possible to mount the files on a disk as above? Do I need to run off a dump file every time?
C:\DOS:>
C:\DOS:>RUN
RUN DOS RUN!!