No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

The case when login SIG WEB display "database abnormal"

Publication Date:  2012-11-01 Views:  59 Downloads:  0
Issue Description
The case when login SIG WEB display "database abnormal"
Alarm Information
none
Handling Process
A、Check Mysql process is normal or not:
linux:~ # ps -ef | grep mysql
root       667     1  0 21:41 ?        00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/linux.pid
mysql      694   667  0 21:41 ?        00:00:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid
-file=/var/lib/mysql/linux.pid --skip-locking --port=3306 --socket=/var/lib/mysql/mysql.sock
root     20827 10469  0 23:02 pts/5    00:00:00 grep mysql
root     20831   736  0 23:02 ?        00:00:00 sh -c df /var/lib/mysql/|grep /
root     20832 20831  0 23:02 ?        00:00:00 sh -c df /var/lib/mysql/|grep /
from the above command,Mysql process is normal。
B、simulate command line to login Mysql.:
linux:/usr/local/SIG/SRS # mysql -u root -p SIG
Enter password:
Generally speaking, there is three the common error. The three solution is as follows:
1、
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
The solution is that:
1>
linux:/usr/local/SIG/SRS # /etc/init.d/mysql stop
Shutting down MySQL..                                                                                        done
2>
linux:/usr/local/SIG/SRS # mysqld_safe --user=mysql --skip-grant-tables --skip-networking &[1] 4447
linux:/usr/local/SIG/SRS # Starting mysqld daemon with databases from /var/lib/mysql
3>
linux:/usr/local/SIG/SRS # mysql -u root mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 5.0.18-standard
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
//execute the update command:
mysql> UPDATE user SET Password=PASSWORD('huawei') where USER='root';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0
//execute flush command:
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
mysql> quit
4>
linux:/usr/local/SIG/SRS # /etc/init.d/mysql restart
Shutting down MySQL.STOPPING server from pid file /var/lib/mysql/linux.pid
081121 23:06:32  mysqld ended
                                                                                                             done
Starting MySQL                                                                                               done
2、
Host 'xxxxxx' is blocked because of many connection errors. Unblock with 'mysqladmin flush-hosts'
the situation is because there is too much connection, and then execute the following command:
linux:/usr/local/SIG/SRS # mysqladmin flush-host -p
Enter password:

3、
linux:~ # mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
This problem can not through command to solve, only can use restart Server to solve.
Root Cause
When login WEB display database abnormal, generally two kind of situations:
1, input the wrong username password when install the Web (can consider to reinstall the database).
2, database is abnormal, positioning mainly have the following two process:
A. check Mysql process is normal or not.
B. simulate command line to login Mysql.
Suggestions
Mysql is the open source and free database after all, stability is not good, but there are three common mistakes, through the above solution can solve most of the Mysql problem.

END