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