比如我想把linux的數(shù)據(jù)庫備份到/home/beinan,數(shù)據(jù)庫的文件名為linuxsir031130.sql,所以應(yīng)該輸入如下的命令。 [root@linuxsir01 root]#/opt/mysql/bin/mysqldump -uroot -p linux > /home/beinan/linuxsir031130.sql Enter password:在這里輸入數(shù)據(jù)庫管理員root的數(shù)據(jù)庫密碼
[root@linuxsir01 root]# /opt/mysql/bin/mysql -uroot -p linux < /home/beinan/linuxsir031130.sql Enter password:在這里輸入密碼
如果機(jī)器好,數(shù)據(jù)庫比較小,幾分鐘就好了。
6]其它一些比較常用的mysql指令;
查看狀態(tài) mysql> show status;
查看進(jìn)程
代碼:
mysql> show processlist; +----+------+-----------+------+---------+------+-------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +----+------+-----------+------+---------+------+-------+------------------+ | 16 | root | localhost | NULL | Query | 0 | NULL | show processlist | +----+------+-----------+------+---------+------+-------+------------------+ 1 row in set (0.00 sec)