Gentoo Archives: gentoo-user

From: Paul Maszy <paulmasz@××××××××××××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Trouble with mysql
Date: Wed, 31 Aug 2005 23:09:19
Message-Id: 4316376D.10806@iriswick.game-host.org
In Reply to: Re: [gentoo-user] Trouble with mysql by Michael Sullivan
1
2
3
4
5
6
7
8     You shouldnt have restarted.
9
10     mysql is already starting on boot up. It showing that many mysql
11 daemons is normal and ok.
12
13     # /etc/init.d/mysql stop
14 --- You will probably get an error here, if everything happened as you
15 said. If not, your done.
16  
17     kill -9 `ps -ef | grep mysql | awk '{ print $2 }'`
18    
19     As for connecting to mysql, try without a password
20     # mysql -u root
21
22
23     See if it connects.
24
25
26
27     Until you determine what is starting it, dont reboot. It just puts
28 you back to square 1. I think the question you are asking is why is
29 mysql already running. Its gotta be starting in the init scripts
30 somehow, and if its not in /etc/init.d/mysql I would check for other
31 scripts starting it.
32
33     # grep mysql /etc/init.d/*
34
35
36
37    
38
39 Michael Sullivan wrote:
40
41
On Wed, 2005-08-31 at 22:37 +0100, Tim Igoe wrote:
42
43
44
Michael Sullivan wrote:
45
46
47
I am having trouble with /etc/init.d/mysql.  I rebooted my system, and
48 when it finished rebooting I tried to connect to the mysql daemon and
49 failed. I looked in /var/log/mysql: There was a file there called
50 mysql.err. The contents were:
51
52 050831 15:47:29 mysqld started
53 050831 15:47:30 Can't start server: Bind on TCP/IP port: Address already
54 in use
55 050831 15:47:30 Do you already have another mysqld server running on
56 port: 3306 ?
57 050831 15:47:30 Aborting
58
59 050831 15:47:30 /usr/sbin/mysqld: Shutdown Complete
60
61 050831 15:47:30 mysqld ended
62
63
64
65
66 check the output of ps aux
67 look for mysqld processes in the list - if it is running then try
68 killing the mysqld processes or restarting the machine
69
70
71
72
I tried netstat | grep '3306':
73
74 bullet mysql # netstat | grep '3306'
75 bullet mysql #
76
77
78
netstat -n | grep 3306
79
80 or
81
82 netstat | grep mysql
83
84 might be better
85
86
87
88
The output was blank, so I assume that port 3306 is NOT in use.  Any
89 ideas?
90
91
92
93
Do you have something else that could be using the port - a rootkit or
94 someone else running a service on the box?
95
96
97
98
99 I did ps aux | grep 'mysqld' and got a listing of several mysqld
100 processes. I killed each one using kill -9 and then rebooted the
101 machine. Once it was fully rebooted I issued another ps aux | grep
102 'mysqld'. Here is the output:
103
104 bullet ~ # ps aux | grep 'mysqld'
105 root 8115 0.0 1.5 2216 948 ? Ss 11:50
106 0:00 /bin/sh /usr/bin/mysqld_safe --defaults-file=/etc/mysql/my.cnf
107 mysql 8151 0.2 3.9 38728 2416 ? S 11:50
108 0:00 /usr/sbin/mysqld --defaults-file=/etc/mysql/my.cnf --basedir=/usr
109 --datadir=/var/lib/mysql --user=mysql
110 --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --port=3306
111 --socket=/var/run/mysqld/mysqld.sock
112 mysql 8153 0.0 3.9 38728 2420 ? S 11:50
113 0:00 /usr/sbin/mysqld --defaults-file=/etc/mysql/my.cnf --basedir=/usr
114 --datadir=/var/lib/mysql --user=mysql
115 --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --port=3306
116 --socket=/var/run/mysqld/mysqld.sock
117 mysql 8154 0.0 3.9 38728 2420 ? S 11:50
118 0:00 /usr/sbin/mysqld --defaults-file=/etc/mysql/my.cnf --basedir=/usr
119 --datadir=/var/lib/mysql --user=mysql
120 --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --port=3306
121 --socket=/var/run/mysqld/mysqld.sock
122 mysql 8155 0.0 3.9 38728 2420 ? S 11:50
123 0:00 /usr/sbin/mysqld --defaults-file=/etc/mysql/my.cnf --basedir=/usr
124 --datadir=/var/lib/mysql --user=mysql
125 --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --port=3306
126 --socket=/var/run/mysqld/mysqld.sock
127 root 8848 0.0 0.8 1448 492 pts/0 S+ 11:51 0:00 grep
128 mysqld
129 bullet ~ #
130
131 I have no idea why so many of them are being started. How do I stop my
132 system from starting more than one mysql daemon?
133
134
135
136
137
138
139 --
140 gentoo-user@g.o mailing list
141
142
143

Replies

Subject Author
Re: [gentoo-user] Trouble with mysql Michael Sullivan <michael@××××××××××××.com>