To enter the mysql from root
To change the database# mysql
To see the tables under the database#use database name;
Ex. use test_test;
To see the particular table details#show tables ;
To restore the database backup from .sql file#select * from table ;
Ex. select * from test_admin ;
To see the current running mysql process#mysql -u username -ppassword databasename < .sql file
Ex. mysql -u test_test1 -ptesting test_test < test.sql
To take the backup of mysql database#mysqladmin processlist or #mysqladmin proc stat
You can restore the dump file back into the database like this:#mysqldump --opt db_name > backup-file.sql
Ex. mysqldump --opt test_test > test.sql
To dump all databases, use the --all-databases option:#mysql db_name < backup-file.sql
Ex. mysql test_test < test.sql
#mysqldump --all-databases > all_databases.sql


Reply With Quote
