这里,介绍一下CentOS下MySQL数据库服务器的构建方法。
安装MySQL及相关组件
首先,安装MySQL。
[root@sample ~]# yum -y install mysql-server ← 安装MySQL
Setting up Install Process
Setting up repositories
dag 100% |=========================| 1.1 kB 00:00
update 100% |=========================| 951 B 00:00
base 100% |=========================| 1.1 kB 00:00
addons 100% |=========================| 951 B 00:00
extras 100% |=========================| 1.1 kB 00:00
Reading repository metadata in from local files
primary.xml.gz 100% |=========================| 106 kB 00:00
update : ################################################## 261/261
Added 5 new packages, deleted 0 old in 2.02 seconds
Reducing Dag RPM Repository for Red Hat Enterprise Linux to included packages only
Finished
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for mysql-server to pack into transaction set.
mysql-server-4.1.20-1.RHE 100% |=========================| 29 kB 00:00
---> Package mysql-server.i386 0:4.1.20-1.RHEL4.1 set to be updated
--> Running transaction check
--> Processing Dependency: libmysqlclient.so.14(libmysqlclient_14) for package: mysql-server
--> Processing Dependency: perl-DBD-MySQL for package: mysql-server
--> Processing Dependency: perl-DBI for package: mysql-server
--> Processing Dependency: perl(DBI) for package: mysql-server
--> Processing Dependency: mysql = 4.1.20-1.RHEL4.1 for package: mysql-server
--> Processing Dependency: libmysqlclient.so.14 for package: mysql-server
--> Processing Dependency: libmysqlclient_r.so.14(libmysqlclient_14) for package: mysql-server
--> Processing Dependency: libmysqlclient_r.so.14 for package: mysql-server
--> Restarting Dependency Resolution with new changes.
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for perl-DBD-MySQL to pack into transaction set.
perl-DBD-MySQL-2.9004-3.1 100% |=========================| 5.4 kB 00:00
---> Package perl-DBD-MySQL.i386 0:2.9004-3.1 set to be updated
---> Downloading header for mysql to pack into transaction set.
mysql-4.1.20-1.RHEL4.1.i3 100% |=========================| 35 kB 00:00
---> Package mysql.i386 0:4.1.20-1.RHEL4.1 set to be updated
---> Downloading header for perl-DBI to pack into transaction set.
perl-DBI-1.40-8.i386.rpm 100% |=========================| 11 kB 00:00
---> Package perl-DBI.i386 0:1.40-8 set to be updated
--> Running transaction check
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
mysql-server i386 4.1.20-1.RHEL4.1 update 9.8 M
Installing for dependencies:
mysql i386 4.1.20-1.RHEL4.1 update 2.9 M
perl-DBD-MySQL i386 2.9004-3.1 base 111 k
perl-DBI i386 1.40-8 base 466 k
Transaction Summary
=============================================================================
Install 4 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 13 M
Downloading Packages:
(1/4): perl-DBD-MySQL-2.9 100% |=========================| 111 kB 00:00
(2/4): mysql-server-4.1.2 100% |=========================| 9.8 MB 00:11
(3/4): mysql-4.1.20-1.RHE 100% |=========================| 2.9 MB 00:03
(4/4): perl-DBI-1.40-8.i3 100% |=========================| 466 kB 00:01
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: perl-DBI ######################### [1/4]
Installing: mysql ######################### [2/4]
Installing: perl-DBD-MySQL ######################### [3/4]
Installing: mysql-server ######################### [4/4]
Installed: mysql-server.i386 0:4.1.20-1.RHEL4.1
Dependency Installed: mysql.i386 0:4.1.20-1.RHEL4.1 perl-DBD-MySQL.i386 0:2.9004-3.1 perl-DBI.i386 0:1.40-8
Complete!