CentOS 安装 mysql 服务器

使用下面的命令:[root@bug ~]# yum install mysql-server服务器输出:[code][root@bug ~]# yum install mysql-server
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile

  • base: mirrors.sonic.net
  • extras: mirror.hmc.edu
  • updates: mirrors.sonic.net
    Setting up Install Process
    Resolving Dependencies
    → Running transaction check
    —> Package mysql-server.x86_64 0:5.0.77-4.el5_6.6 set to be updated
    → Processing Dependency: perl-DBD-MySQL for package: mysql-server
    → Running transaction check
    —> Package perl-DBD-MySQL.x86_64 0:3.0007-2.el5 set to be updated
    → Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================================
Package Arch Version Repository Size

Installing:
mysql-server x86_64 5.0.77-4.el5_6.6 base 9.8 M
Installing for dependencies:
perl-DBD-MySQL x86_64 3.0007-2.el5 base 148 k

Transaction Summary

Install 2 Package(s)
Upgrade 0 Package(s)

Total download size: 10 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): perl-DBD-MySQL-3.0007-2.el5.x86_64.rpm | 148 kB 00:00
(2/2): mysql-server-5.0.77-4.el5_6.6.x86_64.rpm | 9.8 MB 00:02

Total 2.6 MB/s | 10 MB 00:03
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : perl-DBD-MySQL 1/2
Installing : mysql-server 2/2

Installed:
mysql-server.x86_64 0:5.0.77-4.el5_6.6

Dependency Installed:
perl-DBD-MySQL.x86_64 0:3.0007-2.el5

Complete!
[root@bug ~]# [/code]启动Mysql 服务器:[code][root@bug ~]# service mysqld restart
Stopping MySQL: [FAILED]
Initializing MySQL database: WARNING: The host ‘bug.localdomain’ could not be looked up with resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !
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 bug.localdomain 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 mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available on the web at

Support MySQL by buying support/licenses at http://shop.mysql.com
[ OK ]
Starting MySQL: [ OK ]
[root@bug ~]# [/code]