How to know if mysql is in use?
Hello,
i've lost the root mysql password and I want to recover it: I know the steps : /etc/init.d/mysql stop mysqld_safe --skip-grant-tables & mysql -u root mysql> use mysql; mysql> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root'; mysql> flush privileges; mysql> quit /etc/init.d/mysql stop But i don't know if somebody is using the database, and on this case I have to wait. How can I check if somebody is using the mysql database? Thanks |
Code:
show processlist; |
Quote:
Thanks,but I can not access the mysql database, I've lost the root password. |
What i've done to check if somebody was using the mysql database is
$ps axu|grep mysql But i'm quite sure that somewhere we can found somewhat better. Cheers. |
You could use netstat command to check what connections are active...
|
Quote:
Unfortunately in your case, someone who might be connected is just gonna have to suffer a little downtime so you can regain control of your database. ps output isn't going to tell you squat if it's actually being used, only the pid of the mysql daemons listening for connections, etc. |
All times are GMT -5. The time now is 11:18 PM. |