LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-13-2003, 04:56 PM   #1
everythingand2
Member
 
Registered: Oct 2003
Location: Kansas City, MO
Distribution: Slackware 9.1
Posts: 61

Rep: Reputation: 15
Questions about mysqld


I'm running a Slackware Linux box with Mysql 4.0.16 installed. I recently took down my server to reset the root password because I forgot it unfortunately. Well, once I started it back up I checked my processes just to make sure it was running and noticed I had like 10 different mysqld processes running with one command...

jam 32420 32413 0 16:18 ? 00:00:00 ./mysqld start
jam 32421 32420 0 16:18 ? 00:00:00 ./mysqld start
jam 32422 32421 0 16:18 ? 00:00:00 ./mysqld start
jam 32423 32421 0 16:18 ? 00:00:00 ./mysqld start
jam 32424 32421 0 16:18 ? 00:00:00 ./mysqld start
jam 32425 32421 0 16:18 ? 00:00:00 ./mysqld start
jam 32426 32421 0 16:18 ? 00:00:00 ./mysqld start
jam 32427 32421 0 16:18 ? 00:00:00 ./mysqld start
jam 32428 32421 0 16:18 ? 00:00:00 ./mysqld start
jam 32429 32421 0 16:18 ? 00:00:00 ./mysqld start


Is this normal? If not, what is causing this and how can I fix it?

Also, now I'm unable to stop mysql no matter what command I use. I tried using "mysqld stop" and got this error...

031213 16:43:58 Can't start server: Bind on TCP/IP port: Address already in use
031213 16:43:58 Do you already have another mysqld server running on port: 3306 ?
031213 16:43:58 Aborting

031213 16:43:58 mysqld: Shutdown Complete

It says Shutdown is complete but I checked the processes and it's still running. I'm confused. Can anyone help??!!

- Brad
 
Old 12-13-2003, 05:10 PM   #2
g-rod
Member
 
Registered: Dec 2003
Location: Long Island, NY USA
Distribution: RedHat, SUSE
Posts: 336

Rep: Reputation: 30
Manually kill the process.
ps -ef | grep ./mysqld | awk '{print $2}' | xargs kill -9 $1;
Then type to start mysqld again.
 
Old 12-13-2003, 05:12 PM   #3
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 253Reputation: 253Reputation: 253
Yeah, doesn't seem to me that mysqld is starting correctly, its seeing/detecting the rc.mysql start in /etc/rc.d/ as a process or something.

I would try attempt to kill all instances of 'mysqld start' with the kill command.

kill -9 <pid> (Note you can put more than one process id number to kill, separated just by a space, [edit]or grod's kill method will work too[/edit])

And then check either your /var/log/messages or /var/run/mysql for any logs or messages in why its not starting up correctly.

Instead of trying to restart with /etc/rc.d/rc.mysqld start use the command 'mysqld_safe &' instead to see if that works.

Last edited by trickykid; 12-13-2003 at 05:13 PM.
 
Old 12-13-2003, 05:28 PM   #4
everythingand2
Member
 
Registered: Oct 2003
Location: Kansas City, MO
Distribution: Slackware 9.1
Posts: 61

Original Poster
Rep: Reputation: 15
Ok I killed the first process and then when I tried killing the second process it said it didn't exist. I then checked to see if they were running and after only killing one of them, they're all gone. Odd? I think so.

So I started mysql using "mysqld_safe &" and I got about 3 different sets of 10 processes this time. All I had to do was kill one process in each group of numbers and the rest died with it.

Now i'm even more confused.
 
Old 12-13-2003, 05:33 PM   #5
g-rod
Member
 
Registered: Dec 2003
Location: Long Island, NY USA
Distribution: RedHat, SUSE
Posts: 336

Rep: Reputation: 30
You killed the parent process which caused the child process to be killed.
if you type ps -ef the second column is the process id and the third column is the parent process.

As far as why mysql is not working.
I am not sure TrickyKid any ideas. Does the root password need to be changed in mysql?? I don't use mysql that much.
 
Old 12-13-2003, 05:35 PM   #6
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 253Reputation: 253Reputation: 253
What do the processes state now? Can you post ps -aux here after running mysqld_safe & ?

Have you tried connecting to your mysql database?
 
Old 12-13-2003, 05:44 PM   #7
everythingand2
Member
 
Registered: Oct 2003
Location: Kansas City, MO
Distribution: Slackware 9.1
Posts: 61

Original Poster
Rep: Reputation: 15
Mysql is working but because of the 8 - 10 processes or so I didn't think it was running correctly. I did a pstree -p and here's what I came up with...

Code:
  |-mysqld_safe(512)---mysqld(528)---mysqld(530)-+-mysqld(531)
  |                                                                              |-mysqld(532)
  |                                                                              |-mysqld(533)
  |                                                                              |-mysqld(534)
  |                                                                              |-mysqld(535)
  |                                                                              |-mysqld(536)
  |                                                                              |-mysqld(537)
  |                                                                             `-mysqld(538)
When Mysql starts does it start a certain number of additional threads with it? What is the purpose of the extra processes?

Also, why does it give this message...

031213 16:43:58 Can't start server: Bind on TCP/IP port: Address already in use
031213 16:43:58 Do you already have another mysqld server running on port: 3306 ?
031213 16:43:58 Aborting

...when shutting down the server?

Thanks for all your input so far.

- Brad

**** NOTE: THE SPACING IS ALL MESSED UP IN THE PSTREE

Last edited by everythingand2; 12-13-2003 at 05:46 PM.
 
Old 12-13-2003, 05:54 PM   #8
g-rod
Member
 
Registered: Dec 2003
Location: Long Island, NY USA
Distribution: RedHat, SUSE
Posts: 336

Rep: Reputation: 30
Alright lets find out what is binding to that port
login as root
netstat -pln | grep 3306
 
Old 12-13-2003, 06:01 PM   #9
everythingand2
Member
 
Registered: Oct 2003
Location: Kansas City, MO
Distribution: Slackware 9.1
Posts: 61

Original Poster
Rep: Reputation: 15
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 528/mysqld
 
Old 12-13-2003, 06:16 PM   #10
g-rod
Member
 
Registered: Dec 2003
Location: Long Island, NY USA
Distribution: RedHat, SUSE
Posts: 336

Rep: Reputation: 30
OK We now its mysql and not something else. I don't understand why you are getting errors. I am going out for the night. I'll think about this tonight and get back to you tomarrow.
Anyone else have any ideas?
 
Old 12-13-2003, 06:21 PM   #11
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 253Reputation: 253Reputation: 253
Check your /var/run/mysql directory and see if it has a mysql.sock file or more than one that might have gotten corrupt.

You could try shutting down mysql, remove any files in the /var/run/mysql directory and then start it back up again to see if it gives the same error.
 
Old 12-13-2003, 09:04 PM   #12
everythingand2
Member
 
Registered: Oct 2003
Location: Kansas City, MO
Distribution: Slackware 9.1
Posts: 61

Original Poster
Rep: Reputation: 15
I'm also out for the night at the moment but I will be retrying my luck in the morning. Thanks for the help so far guys. I'll let you know how things turn out.
 
Old 12-14-2003, 06:59 AM   #13
everythingand2
Member
 
Registered: Oct 2003
Location: Kansas City, MO
Distribution: Slackware 9.1
Posts: 61

Original Poster
Rep: Reputation: 15
Ok, I don't have a /var/run/mysql directory. My mysql.sock file is in /tmp/mysql.sock. Does that make a difference?
 
Old 12-14-2003, 09:43 AM   #14
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 253Reputation: 253Reputation: 253
Quote:
Originally posted by everythingand2
Ok, I don't have a /var/run/mysql directory. My mysql.sock file is in /tmp/mysql.sock. Does that make a difference?
As far as I know it should have one to my knowledge, just depends on the setup of mysql I would assume. I have version 4.0.15a and mine will create the mysql.sock file in /var/run/mysql

Try creating the directory there and changing the ownership and group ownership with:

chown -R mysql.mysql /var/run/mysql

And shutdown mysql, remove the tmp files in /tmp and then try restarting to see what happens, etc.
 
Old 12-14-2003, 10:32 AM   #15
everythingand2
Member
 
Registered: Oct 2003
Location: Kansas City, MO
Distribution: Slackware 9.1
Posts: 61

Original Poster
Rep: Reputation: 15
Before I do that...

Is the mysql.sock file a file that is created/overwritten everytime mysql is started or is it a file that has to exist before mysql starts?

I don't want to delete it and then completely screw up mysql if it requires that file to start.

Also, is there anything in my.cnf which determines the location of the mysql.sock file?

Last edited by everythingand2; 12-14-2003 at 10:35 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with mysqld karthik85nitt Linux - Newbie 1 06-24-2005 06:21 AM
Mysqld error jjwl89 Linux - Software 2 04-21-2005 04:48 PM
mysqld problem fatman Linux - Software 6 03-26-2003 07:13 AM
mysqld start linuxRules Linux - General 1 07-21-2002 03:06 PM
Mysqld cinnix Linux - General 4 07-08-2001 01:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration