lvm
查看昨天負載情況
iostat 相關的
查看當前靜態內存使用百分比
日誌類型
當前登入用戶
last |sort -r
cmake mysql5.1 5.5
mysql 基本操作 導入導出表,表結構
show status;
show engines;
show variables like '%engine%'; #查看當前庫的engine
show processlist;
mysql -u root -h localhsot -p
mysqldump -u root -p --databases cacti > /opt/db.sql #導出數據庫
mysql --all-databases > all-databases.sql #導出整個數據庫
mysql < db.sql
mysqldump -u root -p cacti > /opt/cactibak.sql #導出整個數據庫中的所有表
mysqldump -u root -p cacti user_auth tables2 > /opt/ser.sql #導出某張表
a.)mysql -u root -p cacti < /opt/cactibak.sql #導入表到數據庫
b.)
mysql>use cacti;
mysql>source /opt/cactibak.sql
mysql>
update tablename set rowname=value where rowname1="127.0.0.1";
grant all on *.* to cacti@"%" identified by 'redhat'; #增加用戶的方法啊!!!
all : insert update delete select
create user username identified by ‘redhat’;
revoke all privileges on *.* from root@"%"; #刪除授權
delete from user where user="rot" and host="%";
alter table t1 rename t2; #重命表名
describe table 表名; == desc table 表名; == show columns from 表名;
show create table 表名; #查看錶詳細結構語句
ALTER TABLE user MODIFY name VARCHAR(30);
ALTER TABLE 表名 ADD 屬性名 1 數據類型 [完整性約束] [FIRST|AFTER 屬性名 2];
ALTER TABLE 表名 DROP 屬性名;
ALTER TABLES user ENGINE=MYISAM|INNODB|MEMORY; #更改表的存儲引擎。
DROP INDEX 索引名 ON 表名;
創建表三種方法:
CREATE TABLE test;
CREATE TABLE datatest SELECT * FROM test; #創建複製數據,但不復製表結構
CREATE TABLE like test; #複製表結構,數據爲空
修改表:
ALTER TABLE test ADD UNIQUE KEY (Couse);
ALTER TABLE test ENGINE=Innodb; #修改表引擎
ALTER TABLE test CHANGE Couse Course VARCHAR(50) NOT NULL;
ALTER TABLE test RENAME TO test1; == RENAME TABLE test TO test1;
CREATE INDEX name_on_student ON student (Name(5) DESC|ASC) USING BTREE; #創建索引
DROP INDEX name_on_student ON student; #刪除表索引