|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Do I have to connect to mysql to find the process IDs (PIDs ) for this usr/local/mysql .. im trying to find parent mysql process and it children. i already know how to do it in ssh, but for some reason im stuck.... any suggestions...
|
|
#2
|
|||
|
|||
|
I must admit that I was unable to completely understand the question, but maybe this will help...
mysqld is often called with the "--pid-file=<filename>" option. You can read the process ID from this file. -Steven |
|
#3
|
|||
|
|||
|
The process names for MySQL contain the word mysql located in
/usr/local/mysql. but I need to know the process IDs (PIDs) associated with these processes and identify the parent mysql process and it children. |
|
#4
|
|||
|
|||
|
I am unsure of what you mean with "located in". I at first assumed that you meant the /usr/local/mysql directory (which is not unix conform by the way), but that makes no sense to me.
My next guess -- when you say located, are you referring to the output of the ps command? If you are, then the PID (Process ID) is usually in the second column. The first line of output of the ps command should be the column titles. To get the PPID, (Parent Process ID) use the -l switch. Code:
ps -efl | grep PID #followed by: ps -efl | grep mysql -ef and -A are equivalent. (On BSD systems use -aux) example output on my BSD box: Code:
/var/db/mysql # ps -Al | grep PID UID PID PPID CPU PRI NI VSZ RSS WCHAN STAT TT TIME COMMAND /var/db/mysql # ps -Al | grep mysql 0 158 1 24 10 0 652 260 wait I+ con- 0:00,01 /bin/sh /usr/local/bin/mysqld_safe 88 199 158 0 2 0 51332 18800 poll S+ con- 1:23,54 /usr/local/libexec/mysqld in this simple example, the mysqld_safe is started by PID#1 and has PID#158. This in turn is the parent of mysqld which has PID#199. this is all well documented in the manpage so you can read it in: Code:
man ps any help?? -Steven ADDENDUM: You can, of course, us the -O or -o switches and tell ps which columns you want to see (and the order): Code:
/var/db/mysql # ps -a -o ppid,pid,command | grep mysql
1 158 /bin/sh /usr/local/bin/mysqld_safe
158 199 /usr/local/libexec/mysqld
|
|
#5
|
|||
|
|||
|
btw, out of curiosity, what is your native language?
-Steven |
|
#6
|
|||
|
|||
|
I tried this but that what i get , im not sure if it's right. do I need to connect to mysql
bash: /usr/local/mysql: is a directory bash-2.05$ ps -efl | grep PID F S UID PID PPID C PRI NI ADDR SZ WCHAN STIME TTY TIME CMD 8 S 3236 3005 0 50 20 ? 121 ? 23:51:44 pts/2 0:00 grep PID bash-2.05$ ps -efl | grep mysql 8 S 3238 3005 0 50 20 ? 121 ? 23:52:07 pts/2 0:00 grep mysql /native language is arabic |
|
#7
|
|||
|
|||
|
ok. Well, ps is only showing you your own grep commands (because they contain the keywords):
Code:
F S UID PID PPID C PRI NI ADDR SZ WCHAN STIME TTY TIME CMD 8 S 3236 3005 0 50 20 ? 121 ? 23:51:44 pts/2 0:00 grep PID 8 S 3238 3005 0 50 20 ? 121 ? 23:52:07 pts/2 0:00 grep mysql That is fine, but it is not showing the mysql daemon. Either mysqld is not running, or your version of ps requires that you use different switches, like -Al or -axl. Your manpages will explain the correct switches: man ps -Steven |
|
#8
|
|||
|
|||
|
auctually i can't connect to mysql, every time i try i get this message, and i don't understand what it is:
ERROR 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (146) |
|
#9
|
|||
|
|||
|
As I said, ps shows that mysql is not even running!!
-Steven |
|
#10
|
|||
|
|||
|
Quote:
how can i get it to run |
|
#11
|
|||
|
|||
|
well.., do you even know if it is installed? which operating system are you using? which version of mysql are you using?
Code:
uname -a
path_to_mysqld/mysqld -V #(if you don't know where to find mysqld try
# find / -name mysqld -print
then look in your /etc/rc.d/ or /usr/local/etc/rc.d (or wherever your startup scripts are located, since I have no idea which unix youre using) and try to locate the startup script for the mysql-server. -Steven |
|
#12
|
|||
|
|||
|
yes it's installed, its installed on a unix system that i have to connect to remotely. i have been connected to before but now everytime i enter my password i get the following message ::
Enter password: ERROR 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (146) im not sure what this means |
|
#13
|
|||
|
|||
|
It means mySQL is not running like he said before.
Try reading the documentation here: http://dev.mysql.com/doc/mysql/en/Automatic_start.html It will help you to get mySQL started so that you can connect to it again. *edit: You might need to edit your my.cf file and specify where the myslq.sock is located. You can also find out how to do that in the documentation. |
|
#14
|
|||
|
|||
|
Thanks for all your HELP guys, i still cant connect to mysql i should contact someone to get it running
Thank You |
|
#15
|
|||
|
|||
|
...
|
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > how can i find the PIDs in MySql |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|