標籤: MySQL學習筆記:以school資料庫為例:建立資料庫 create database school character set utf8 { character set gbk 表示資料庫用的字元集為gbk,還有utf8,unicode等}刪除資料庫 drop database school {delete }以student表為例建立表:create table student( ID int unsigned not null
標籤:1、資料移轉將/tmp/t3.txt中的資料匯入到t3表中,資料以逗號為分割符load data infile ‘/tmp/t3.txt’ into table t3 fields terminated by ‘,‘;將table2表中的資料匯出為檔案data.txt,以逗號為分隔字元SELECT * INTO OUTFILE ‘data.txt‘-> FIELDS TERMINATED BY ‘,‘->&
標籤:mysql壓力測試工具工具名稱:mysqlha_sysbench.sh工具用途:用於MySQL壓力測試 (2種功能:填充資料&&測試資料)工具參數:options:-P 需要測試的連接埠-D 需要測試的db名字-H 需要測試的host-S 填充&&測試 表的資料量,default 100w-C 填充&&測試 表的數量, default 1-T prepare and run ,prepare is 製造資料 run
標籤: 查看欄位編碼:show full columns from t2;show variables like ‘%character%‘;show variables like ‘collation_%‘;show variables like ‘character_set_%‘;修改庫字元集:alter database test character set gbk;修改表字元集:alter table t1 character set gbk;修改欄位字元集:alter table t2
標籤:錯誤記錄檔 error log尋找日誌路徑命令show variables like "log_error";尾碼為.err的檔案 二進位日誌 bin log記錄修改資料的語句尋找日誌配置show variables like "log_bin";如果是關閉的,需要在設定檔中開啟,並且手動建立打算放日誌的目錄log_bin=/mysql/binlog/mysql-bin此檔案需要用mysqlbinlog來解析 通用日誌 general log&