環(huán)境變量設置:單擊桌面我的電腦右鍵屬性->高級->環(huán)境變量->雙擊Path項,添加C:/MySQL5.1.40/bin目錄,如果要使用SDK開發(fā),則要添加Lib和include目錄到對應的Lib和include環(huán)境變量中; 環(huán)境變量設好,在開始菜單->運行->CMD,執(zhí)行MySQLD,或是直接切換到C:/MySQL5.1.40/bin目錄雙擊運行MySQLD.exe服務程序,也可以服務的形式運行: 注意mysql安裝目錄不要有中文或空格,在SDK開發(fā)中,如QT會有意想不到的問題; 安裝服務 mysqld -install 啟動服務 net start mysql 停止服務 net stop mysql 刪除服務 mysqld -remove 再打開一個CMD窗口,執(zhí)行MySQL -h localhost回車,就可以看到 { Welcome to the MySQL monitor. Commands end with ; or /g. Your MySQL connection id is 5 Server version: 5.1.40-community MySQL Community Server (GPL) Type 'help;' or '/h' for help. Type '/c' to clear the current input statement. } 表示成功連接到MySQL了數(shù)據(jù)庫了,接下來,可以查看數(shù)據(jù)庫, ->show databases; +--------------------+ | Database | +--------------------+ | information_schema | | test | +--------------------+ 2 rows in set (0.01 sec) ->use test; Database changed
--可以支持常量表達式和MSSQL或Oracle的select 444+44 from dual一樣; mysql> select 444+44; +--------+ | 444+44 | +--------+ | 488 | +--------+ 1 row in set (0.00 sec)