Gentoo Archives: gentoo-user

From: Michael Sullivan <michael@××××××××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Trouble with mysql
Date: Wed, 31 Aug 2005 21:57:49
Message-Id: 1125525169.11368.17.camel@baby.espersunited.com
In Reply to: Re: [gentoo-user] Trouble with mysql by Tim Igoe
1 On Wed, 2005-08-31 at 22:37 +0100, Tim Igoe wrote:
2 >
3 > Michael Sullivan wrote:
4 > > I am having trouble with /etc/init.d/mysql. I rebooted my system, and
5 > > when it finished rebooting I tried to connect to the mysql daemon and
6 > > failed. I looked in /var/log/mysql: There was a file there called
7 > > mysql.err. The contents were:
8 > >
9 > > 050831 15:47:29 mysqld started
10 > > 050831 15:47:30 Can't start server: Bind on TCP/IP port: Address already
11 > > in use
12 > > 050831 15:47:30 Do you already have another mysqld server running on
13 > > port: 3306 ?
14 > > 050831 15:47:30 Aborting
15 > >
16 > > 050831 15:47:30 /usr/sbin/mysqld: Shutdown Complete
17 > >
18 > > 050831 15:47:30 mysqld ended
19 > >
20 >
21 >
22 >
23 > check the output of ps aux
24 > look for mysqld processes in the list - if it is running then try
25 > killing the mysqld processes or restarting the machine
26 >
27 > >
28 > > I tried netstat | grep '3306':
29 > >
30 > > bullet mysql # netstat | grep '3306'
31 > > bullet mysql #
32 >
33 > netstat -n | grep 3306
34 >
35 > or
36 >
37 > netstat | grep mysql
38 >
39 > might be better
40 >
41 > >
42 > > The output was blank, so I assume that port 3306 is NOT in use. Any
43 > > ideas?
44 > >
45 >
46 > Do you have something else that could be using the port - a rootkit or
47 > someone else running a service on the box?
48
49
50 I did ps aux | grep 'mysqld' and got a listing of several mysqld
51 processes. I killed each one using kill -9 and then rebooted the
52 machine. Once it was fully rebooted I issued another ps aux | grep
53 'mysqld'. Here is the output:
54
55 bullet ~ # ps aux | grep 'mysqld'
56 root 8115 0.0 1.5 2216 948 ? Ss 11:50
57 0:00 /bin/sh /usr/bin/mysqld_safe --defaults-file=/etc/mysql/my.cnf
58 mysql 8151 0.2 3.9 38728 2416 ? S 11:50
59 0:00 /usr/sbin/mysqld --defaults-file=/etc/mysql/my.cnf --basedir=/usr
60 --datadir=/var/lib/mysql --user=mysql
61 --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --port=3306
62 --socket=/var/run/mysqld/mysqld.sock
63 mysql 8153 0.0 3.9 38728 2420 ? S 11:50
64 0:00 /usr/sbin/mysqld --defaults-file=/etc/mysql/my.cnf --basedir=/usr
65 --datadir=/var/lib/mysql --user=mysql
66 --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --port=3306
67 --socket=/var/run/mysqld/mysqld.sock
68 mysql 8154 0.0 3.9 38728 2420 ? S 11:50
69 0:00 /usr/sbin/mysqld --defaults-file=/etc/mysql/my.cnf --basedir=/usr
70 --datadir=/var/lib/mysql --user=mysql
71 --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --port=3306
72 --socket=/var/run/mysqld/mysqld.sock
73 mysql 8155 0.0 3.9 38728 2420 ? S 11:50
74 0:00 /usr/sbin/mysqld --defaults-file=/etc/mysql/my.cnf --basedir=/usr
75 --datadir=/var/lib/mysql --user=mysql
76 --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --port=3306
77 --socket=/var/run/mysqld/mysqld.sock
78 root 8848 0.0 0.8 1448 492 pts/0 S+ 11:51 0:00 grep
79 mysqld
80 bullet ~ #
81
82 I have no idea why so many of them are being started. How do I stop my
83 system from starting more than one mysql daemon?
84
85 --
86 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] Trouble with mysql Paul Maszy <paulmasz@××××××××××××××××××.org>