Difference between revisions of "Mysql database restore"
From Nuclear Physics Group Documentation Pages
Jump to navigationJump to searchLine 21: | Line 21: | ||
# UREKA, do a little victory dance! | # UREKA, do a little victory dance! | ||
# Now edit Wiki with update | # Now edit Wiki with update | ||
+ | # Finally, make sure MySQL starts automatically: chkconfig --level 35 mysqld on |
Latest revision as of 11:13, 2 October 2008
MySQL restore.
After Roengen was moved to a Virtual system running RHEL5, I did the following to restore MySQL functionality on Roentgen:
- Install mysql-server on Roentgen.
- Install MySQL 4.1.x mysql-server on Fermi (a 64 bit RHEL4 machine) so we can read the old roentgen files.
- Copy the Mysql database to /net/data/pumpkin1/VM/roentgen_var/mysql
- Load this database into Fermi's Mysql: link db directory (step 2) to /var/lib/mysql on Fermi.
- Startup mysqld on Fermi (execute mysqld_safe)
- Dump database: mysqldump -u root -p --all-databases | gzip -c > /net/data/pumpkin1/VM/roentgen_var/mysql_db.mysql.gz
- Initialize the MySQL on roentgen: mysql_install_db
- Start server: mysql_safe --user=mysql
- Restore old database from dump file: zcat /net/data/pumpkin1/VM/roentgen_var/mysql_db.mysql.gz | mysql
- Shutdown the database: mysqladmin shutdown
- Startup again: mysql_safe --user=mysql
- Check to see if grant tables are now correct:
- try "mysql" to see if you can get in, no.
- try "mysql -p" to check super user password.
- Drop the anonymous and guest users:
mysql -u root -p
>> use mysql;
>> select Host,User,Password,Select_priv,Super_priv from user;
>> delete from user where User=;
>> delete from user where User='guest';
- Check wiki: http://nuclear.unh.edu/wiki
- UREKA, do a little victory dance!
- Now edit Wiki with update
- Finally, make sure MySQL starts automatically: chkconfig --level 35 mysqld on