存档

2008年7月 的存档

Fixed: Can not start mysql service

2008年7月11日 没有评论

Install mysql in CentOS4.5 as default setting, and later find mysqld does not exist.

[root@perl ~]# service mysqld start
mysqld: unrecognized service

[root@perl ~]# mysql
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)

Check the current mysql package:
[root@perl ~]# rpm -qa | grep mysql
libdbi-dbd-mysql-0.6.5-10.RHEL4.1
mysql-4.1.20-2.RHEL4.1
mysqlclient10-3.23.58-4.RHEL4.1
mysql-devel-4.1.20-2.RHEL4.1

The root cause is no mysql-server package installed. Just use yum to install this package:
[root@perl ~]# yum install mysql-server
Setting up Install Process
Setting up repositories
update 100% |=========================| 951 B 00:01
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
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-3.RHE 100% |=========================| 30 kB 00:03
—> Package mysql-server.i386 0:4.1.20-3.RHEL4.1.el4_6.1 set to be updated
–> Running transaction check

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
mysql-server i386 4.1.20-3.RHEL4.1.el4_6.1 update 9.8 M

Transaction Summary
=============================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 9.8 M
Is this ok [y/N]: y
Downloading Packages:
(1/1): mysql-server-4.1.2 100% |=========================| 184 kB 05:42
http://ftp.cs.pu.edu.tw/Linux/CentOS/4.6/updates/i386/RPMS/mysql-server-4.1.20-3.RHEL4.1.el4_6.1.i386.rpm: [Errno 4] Socket Error: timed out
Trying other mirror.
(1/1): mysql-server-4.1.2 100% |=========================| 2.4 MB 03:11
http://ftp.hostrino.com/pub/centos/4.6/updates/i386/RPMS/mysql-server-4.1.20-3.RHEL4.1.el4_6.1.i386.rpm: [Errno 4] Socket Error: timed out
Trying other mirror.
(1/1): mysql-server-4.1.2 100% |=========================| 3.3 MB 02:30
http://ftp.twaren.net/Linux/CentOS/4.6/updates/i386/RPMS/mysql-server-4.1.20-3.RHEL4.1.el4_6.1.i386.rpm: [Errno 4] Socket Error: timed out
Trying other mirror.
(1/1): mysql-server-4.1.2 100% |=========================| 3.4 MB 00:39
http://ftp.stu.edu.tw/Linux/CentOS/4.6/updates/i386/RPMS/mysql-server-4.1.20-3.RHEL4.1.el4_6.1.i386.rpm: [Errno 4] Socket Error: timed out
Trying other mirror.
(1/1): mysql-server-4.1.2 100% |=========================| 9.8 MB 00:09
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: mysql-server ######################### [1/1]

Installed: mysql-server.i386 0:4.1.20-3.RHEL4.1.el4_6.1
Complete!

OK, the mysqld service can be started now.

[root@perl ~]# service mysqld start
Initializing MySQL database: [ OK ]
Starting MySQL: [ OK ]
[root@perl ~]#

Fixed.

分类: 科技 标签: