1、直接apt-get 安裝:
apt-get?install?mysql-server-5.0
2、安裝啟動后出現(xiàn)錯誤信息:(中文)
*?Stopping?MySQL?database?server?mysqld?[?OK?]
安裝mysql?時出現(xiàn)下列錯誤,請教高手!
*?Starting?MySQL?database?server?mysqld?[fail]
invoke-rc.d:?initscript?mysql,?action?"start"?failed.
dpkg:處理?mysql-server-5.0?(--configure)時出錯:
子進程?post-installation?script?返回了錯誤號?1
dpkg:依賴關(guān)系問題使得?mysql-server?的配置工作不能繼續(xù):
mysql-server?依賴于?mysql-server-5.0;然而:
軟件包?mysql-server-5.0?還沒有被配置。
dpkg:處理?mysql-server?(--configure)時出錯:
依賴關(guān)系問題?-?仍未被配置
Processing?triggers?for?libc6?
ldconfig?deferred?processing?now?taking?place
在處理時有錯誤發(fā)生:
mysql-server-5.0
mysql-server
E:?Sub-process?/usr/bin/dpkg?returned?an?error?code?(1) 英文錯誤信息是:
invoke-rc.d:?initscript?apparmor,?action?"force-reload"?failed.
*?Starting?MySQL?database?server?mysqld
fail!
invoke-rc.d:?initscript?mysql,?action?"start"?failed.
dpkg:?error?processing?mysql-server-5.0?(--configure):
subprocess?post-installation?script?returned?error?exit?status?1
dpkg:?dependency?problems?prevent?configuration?of?mysql-server:
mysql-server?depends?on?mysql-server-5.0;?however:
Package?mysql-server-5.0?is?not?configured?yet.
dpkg:?error?processing?mysql-server?(--configure):
dependency?problems?-?leaving?unconfigured
Errors?were?encountered?while?processing:
mysql-server-5.0
mysql-server
E:?Sub-process?/usr/bin/dpkg?returned?an?error?code?(1) 出現(xiàn)錯誤的原因是我修改了ubuntu的默認(rèn)網(wǎng)絡(luò)設(shè)置(
/etc/network/interfaces
),刪除了ubuntu的
loopback接口,我的解決方法如下:ubuntu原來默認(rèn)設(shè)置:auto?lo
iface?lo?inet?loopback
被我修改成靜態(tài)ip:
auto?eth0
iface?eth0?inet?static
address?10.100.24.31
netmask?255.255.255.0
gateway?10.100.24.254
將上面兩部分合起來就可以增加一個Loopback接口
auto?eth0
iface?eth0?inet?static
address?10.100.24.31
netmask?255.255.255.0
gateway?10.100.24.254
auto?lo
iface?lo?inet?loopback?
重啟系統(tǒng),這時再安裝mysql-server就ok了~
3、允許其他機器連接、訪問到數(shù)據(jù)庫:
修改文件 /etc/mysql/my.cnf,將
bind-address=127.0.0.1
改為
bind-address=0.0.0.0
這樣將允許所有ip訪問數(shù)據(jù)庫
參考資料:
http://forum.ubuntu.org.cn/viewtopic.php?p=757703?http://blog.csdn.net/redvalley/archive/2008/04/27/2333702.aspx問題2也可以參考一下
這里的方法,似乎更簡單,也不用改動network設(shè)置,不過不知可不可以,沒驗證過~