Today, when I recovered a database, I was really depressed. I used a graphical interface (MySQL administraotr), and the backup file was about 8 Mb. It was nearly 40 minutes after recovery, it is as slow as a cow (my machine configures Core 2 + 2 GB memory ). At last, it was shown that the database was successfully restored, but the recovered database was still not found several times.
I 'd like to try it through the command line. The result is ...... In less than two seconds, I thought it would be okay, but the miracle occurred. I refreshed the list and the database actually showed up. It was amazing.
The following is a command line. I can't remember it. It will be easy to check it after it is put here.
# Cd/usr/local/MySQL/bin/
// Create a database
# Mysqladmin-uroot-ppass create database_name
// Restore the database
# Mysql-uroot-ppass database_name <db_backup. SQL
// Add a user to the database and set the access permission
# Mysql-uroot-ppass
Mysql> grant all privileges on database_name. * To 'user' @ 'localhost' identified by "pass ";