當mysql無法啟動出現innodb錯誤時
請打開mysql安裝目錄下的mysqlx.x/data/的.err檔案檢查是否出現ib_logfile0 is of different size
如果是請將 mysqlx.x/data/下的 ib_logfile0, ib_logfile1 然後重啟則刪掉的檔當會重建.
會出現這種原因大部分是變更到my.ini檔的設定
2012年10月22日 星期一
2010年8月11日 星期三
mysql 連線數
#查詢目前MySQL Process 狀況
mysql> show processlist;
#查詢目前MySQL max connections
mysql> show variables like 'max_connections';
#設定MySQL max connections
mysql> set GLOBAL max_connections=200;
但因為MySQL重開後, max_connections的設定值就會被清掉
可在 my.cnf裡設定 set-variable = max_connections=200
存檔後,重新啟動MySQL即可
mysql> show processlist;
#查詢目前MySQL max connections
mysql> show variables like 'max_connections';
#設定MySQL max connections
mysql> set GLOBAL max_connections=200;
但因為MySQL重開後, max_connections的設定值就會被清掉
可在 my.cnf裡設定 set-variable = max_connections=200
存檔後,重新啟動MySQL即可
2009年10月20日 星期二
excel vba中抓取mysql特定資料表的特定欄位的資料
1.先去下載MySQL Connector ODBC
2.安裝好後設定odbc
3.進入EXCEL Visual Basic編輯器 -> 選單上 "工具" 選項 -> "設定引用項目" -> 將 "Microsoft ActiveX Data Objects 2.8 Library" 打勾 -> 確定
4.使用ADODB 連結
Dim oConn As ADODB.Connection
Set oConn = New ADODB.Connection
oConn.Open "DRIVER={MySQL ODBC 5.1 Driver};" & _
"SERVER=127.0.0.1;" & _
"DATABASE=mysql" & _
"USER=user;" & _
"PASSWORD=xxxx;" & _
"Option=3"
2.安裝好後設定odbc
3.進入EXCEL Visual Basic編輯器 -> 選單上 "工具" 選項 -> "設定引用項目" -> 將 "Microsoft ActiveX Data Objects 2.8 Library" 打勾 -> 確定
4.使用ADODB 連結
Dim oConn As ADODB.Connection
Set oConn = New ADODB.Connection
oConn.Open "DRIVER={MySQL ODBC 5.1 Driver};" & _
"SERVER=127.0.0.1;" & _
"DATABASE=mysql" & _
"USER=user;" & _
"PASSWORD=xxxx;" & _
"Option=3"
MS SQL SERVER資料檔轉入MY SQL指令
LOAD DATA INFILE 'file_name' INTO TABLE table_name FIELDS TERMINATED BY ',' ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '\r\n'
訂閱:
文章 (Atom)
