一、Mysql的安裝
首先,看看自己電腦裡是否安裝了Mysql軟件rpm -qa | grep mysql
如果沒有安裝,則放入光盤:rpm -ivh mysql-server-*.rpm(如果不能直接安裝,提示libmysqlclients.so.15 is ﻪneeded之類的錯誤)
那麼,進入光盤下的CenOS目錄中:
[root@localhost CentOS]# rpm -ivh mysql-server-5.0.45-7.el5.i386.rpm
error: Failed dependencies:
libmysqlclient.so.15 is needed by mysql-server-5.0.45-7.el5.i386
libmysqlclient.so.15(libmysqlclient_15) is needed by ﻪmysql-server-5.0.45-7.el5.i386
libmysqlclient_r.so.15 is needed by mysql-server-5.0.45-7.el5.i386
libmysqlclient_r.so.15(libmysqlclient_15) is needed by ﻪmysql-server-5.0.45-7.el5.i386
mysql = 5.0.45-7.el5 is needed by mysql-server-5.0.45-7.el5.i386
perl-DBD-MySQL is needed by mysql-server-5.0.45-7.el5.i386
[root@localhost CentOS]# rpm -ivh mysql-5.0.45-7.el5.i386.rpm
Preparing... ########################################### [100%]
1:mysql ########################################### [100%]
[root@localhost CentOS]# rpm -ivh mysql-server-5.0.45-7.el5.i386.rpm
error: Failed dependencies:
perl-DBD-MySQL is needed by mysql-server-5.0.45-7.el5.i386
[root@localhost CentOS]# rpm -ivh perl-DBD-MySQL-3.0007-1.fc6.i386.rpm
Preparing... ########################################### [100%]
1:perl-DBD-MySQL ########################################### [100%]
[root@localhost CentOS]# rpm -ivh mysql-server-5.0.45-7.el5.i386.rpm
Preparing... ########################################### [100%]
1:mysql-server ########################################### [100%]
[root@localhost CentOS]#
請大家注意:
解決包依賴順序:Perl-DBD=>mysql=>mysql-server
或者,你的網速快,便可以一步登天:yum install mysql-server
二、Mysql服務的啟動、自動運行
老生常談的話題了,在此略掉,可以參考別的服務的命令。
三、登錄
Mysql默認用戶名為“root”,密碼為空,初次登陸:
mysqladmin -u root -p 原密碼 新密碼
這樣就可以改密碼了。
四、設置phpMyAdmin
1、下載phpMyAdmin版本號.tar.gz
下載地址:http://www.anxia.com/soft/4969.html
2、解壓到/var/www/html下,如需要則修改權限
3、在浏覽器中即可訪問
如果出現“無法載入mysql擴展,請檢查PHP設置”的錯誤,在CenOS下,是缺少php-mysql軟件導致,進入DVD光盤:
[root@localhost CentOS]# rpm -ivh php-pdo-5.1.6-20.el5.i386.rpm
Preparing... ########################################### [100%]
1:php-pdo ########################################### [100%]
[root@localhost CentOS]# rpm -ivh php-mysql-5.1.6-20.el5.i386.rpm
Preparing... ########################################### [100%]
1:php-mysql ########################################### [100%]
即可搞定!