linux下mysql官网安装方法。
Distribution specific instructions are shown below:
* Red Hat Linux, Fedora, CentOS
For Red Hat and similar distributions, the MySQL distribution
is divided into a number of separate packages, mysql for the
client tools, mysql-server for the server and associated
tools, and mysql-libs for the libraries. The libraries are
required if you want to provide connectivity from different
languages and environments such as Perl, Python and others.
To install, use the yum command to specify the packages that
you want to install. For example:
root-shell> yum install mysql mysql-server mysql-libs mysql-server
Loaded plugins: presto, refresh-packagekit
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package mysql.x86_64 0:5.1.48-2.fc13 set to be updated
—> Package mysql-libs.x86_64 0:5.1.48-2.fc13 set to be updated
—> Package mysql-server.x86_64 0:5.1.48-2.fc13 set to be updated
–> Processing Dependency: perl-DBD-MySQL for package: mysql-server-5
.1.48-2.fc13.x86_64
–> Running transaction check
—> Package perl-DBD-MySQL.x86_64 0:4.017-1.fc13 set to be updated
–> Finished Dependency Resolution
Dependencies Resolved
=====================================================================
===========
Package Arch Version Repository
Size
=====================================================================
===========
Installing:
mysql x86_64 5.1.48-2.fc13 updates
889 k
mysql-libs x86_64 5.1.48-2.fc13 updates
1.2 M
mysql-server x86_64 5.1.48-2.fc13 updates
8.1 M
Installing for dependencies:
perl-DBD-MySQL x86_64 4.017-1.fc13 updates
136 k
Transaction Summary
=====================================================================
===========
Install 4 Package(s)
Upgrade 0 Package(s)
Total download size: 10 M
Installed size: 30 M
Is this ok [y/N]: y
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 10 M
(1/4): mysql-5.1.48-2.fc13.x86_64.rpm | 889 kB
00:04
(2/4): mysql-libs-5.1.48-2.fc13.x86_64.rpm | 1.2 MB
00:06
(3/4): mysql-server-5.1.48-2.fc13.x86_64.rpm | 8.1 MB
00:40
(4/4): perl-DBD-MySQL-4.017-1.fc13.x86_64.rpm | 136 kB
00:00
———————————————————————
———–
Total 201 kB/s | 10 MB
00:52
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : mysql-libs-5.1.48-2.fc13.x86_64
1/4
Installing : mysql-5.1.48-2.fc13.x86_64
2/4
Installing : perl-DBD-MySQL-4.017-1.fc13.x86_64
3/4
Installing : mysql-server-5.1.48-2.fc13.x86_64
4/4
Installed:
mysql.x86_64 0:5.1.48-2.fc13 mysql-libs.x86_64 0:5.1.48-
2.fc13
mysql-server.x86_64 0:5.1.48-2.fc13
Dependency Installed:
perl-DBD-MySQL.x86_64 0:4.017-1.fc13
Complete!
MySQL and the MySQL server should now be installed. A sample
configuration file is installed into /etc/my.cnf. An init
script, to start and stop the server, will have been installed
into /etc/init.d/mysqld. To start the MySQL server use
service:
root-shell> service mysqld start
To enable the server to be started and stopped automatically
during boot, use chkconfig:
root-shell> chkconfig –levels 235 mysqld on
Which enables the MySQL server to be started (and stopped)
automatically at the specified the run levels.
The database tables will have been automatically created for
you, if they do not already exist. You should, however, run
mysql_secure_installation to set the root passwords on your
server.