http://www.51cto.com/html/2005/1028/9851.htm可以將這個指令碼放進crontab,每天淩晨執行一次,自動備份 這個指令碼每天最多隻執行一次,而且只保留最近五天的備份在伺服器上。 #!/bin/bash #This is a ShellScript For Auto DB Backup #Powered by aspbiz #2004-09 #Setting #設定資料庫名,資料庫登入名稱,密碼,備份路徑,日誌路徑,資料檔案位置,#以及備份方式
一直以為mysql隨機查詢幾條資料,就用Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->SELECT * FROM `table` ORDER BY RAND() LIMIT 5就可以了。但是真正測試一下才發現這樣效率非常低。一個15萬餘條的庫,查詢5條資料,居然要8秒以上查看官方手冊,也說rand()放在ORDER BY
在Windows下面利用QT開發資料庫應用,如MYSQL,首先,我們必須利用源碼編譯MYSQL驅動庫;1)安裝qt-sdk-win-opensource-2010.02.1.exe此時,QT安裝了QT Creator,假定目錄為:E:/Qt/2010.02.1/,可以選擇安裝MingW;此時,E:/Qt/2010.02.1/QT為Qt庫的安裝位置;2)安裝MySQl,假定目錄為:include 路徑為:D:/MySQL/MySQL Server
1. 匹配型子查詢的改寫select * from table1 where column1 in (select column2a from table2 where column2b = value);改寫為:select table1.* from table1, table2 where table1.column1 = table2.column2a and table2.column2b = value;2. 非匹配(即缺失)型子查詢的改寫select * from table1
Mysql4安裝Client does not support authentication protocol requested問題的解決 今天升級了一下Mysql資料庫,結果出現了以下錯誤: Client does not support authentication protocol requested by server; consider upgrading MySQL client升級到4.1.7版:[root@eygle gbook]# mysql -uroot -p -