2015年12月24日 星期四

MYSQL OPERATOR

登入mysql 需要使用下列指令,進行資料庫訊息的檢查:

mysql> show databases; <==列出有那些資料庫可使用










mysql>show tables; <==列出Syslog DB裏的Tables

















mysql>use dbname;










mysql>desc SystemEvens; <==列出SystemEvents Table Schema


列出SystemEvents Table 前10筆資料mysql>select * from SystemEvents limit 10;
刪除SystemEvents表中FromHost欄位是'TrafficCacti'mysql>delete SystemEvents where FromHost = 'TrafficCacti';刪除SystemEvents表,ReceivedAt 時間大於2015-12-01的資料mysql> delete from SystemEvents where ReceivedAt < '2015-12-01';
Truncate Tablemysql>TRUNCATE TABLES SystemEvents;Optimize Tablemysql> optimize table SystemEvents;

沒有留言:

張貼留言