直接安裝下載的rpm包有的時候會因為缺少mysql的依賴庫而無法安裝成功
可通過執行命令來實現安裝操作,如下命令是安裝mysql用戶端,伺服器和C語言開發環境:
sudo yum install mysql mysql-server mysql-devel
參考:
[root@lee1 ~]# sudo yum install mysql mysql-server mysql-devel
已載入外掛程式:presto, refresh-packagekit
設定安裝進程
包 mysql-5.1.55-1.fc13.i686 已安裝並且是最新版本
解決依賴關係
--> 執行事務檢查
---> 軟體包 mysql-devel.i686 0:5.1.55-1.fc13 將被 升級
---> 軟體包 mysql-server.i686 0:5.1.55-1.fc13 將被 升級
--> 處理依賴關係 perl(DBI),它被軟體包 mysql-server-5.1.55-1.fc13.i686 需要
--> 處理依賴關係 perl-DBD-MySQL,它被軟體包 mysql-server-5.1.55-1.fc13.i686 需要
--> 處理依賴關係 perl-DBI,它被軟體包 mysql-server-5.1.55-1.fc13.i686 需要
--> 執行事務檢查
---> 軟體包 perl-DBD-MySQL.i686 0:4.017-1.fc13 將被 升級
---> 軟體包 perl-DBI.i686 0:1.609-4.fc13 將被 升級
--> 完成依賴關係計算
依賴關係解決
================================================================================
軟體包 架構 版本 倉庫 大小
================================================================================
正在安裝:
mysql-devel i686 5.1.55-1.fc13 updates 128 k
mysql-server i686 5.1.55-1.fc13 updates 8.3 M
為依賴而安裝:
perl-DBD-MySQL i686 4.017-1.fc13 updates 137 k
perl-DBI i686 1.609-4.fc13 fedora 707 k
在安裝的過程中會下載mysql的依賴庫,此時要確保機器能夠連上互連網。
安裝完後 重啟mysql 重啟命令如下:
service mysqld restart
參考:
[root@lee1 ~]# service mysqld restart
停止 mysqld: [確定]
初始化 MySQL 資料庫: Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h lee1 password 'new-password'
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/bin/mysqlbug script!
[確定]
正在啟動 mysqld: [確定]
重啟成功後就可以直接輸入mysql進入mysql的資料庫了。
參考:
[root@lee1 ~]# mysql
Welcome to the MySQL monitor. Commands end with ; or /g.
Your MySQL connection id is 2
Server version: 5.1.55 Source distribution
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license
Type 'help;' or '/h' for help. Type '/c' to clear the current input statement.
mysql>