Saturday, January 14, 2012

ERROR 1146 (42S02): Table ‘mysql.servers’ doesn’t exist

Solution
# mysql_fix_privilege_tables 
And run the following command.
cat /usr/share/mysql/mysql_fix_privilege_tables.sql | /usr/bin/mysql --no-defaults --force --user=root --password --host=localhost --database=mysql
You will need root password. 

ImportError: cannot import name _ yum error

You may get this error while  installing something using yum.

Error:

Traceback (most recent call last):
  File "/usr/bin/yum", line 28, in ?
    import yummain
  File "/usr/share/yum-cli/yummain.py", line 30, in ?
    from yum import _
ImportError: cannot import name _


Reason:
Yum is corrupt.

Solution:
Update the yum forcefully.
You can get the latest yum from net. In my case it was for openvz container.
http://wiki.openvz.org/Install_yum#CentOS_5_i386

Download using wget:
wget http://mirror.centos.org/centos/5/os/i386/CentOS/yum-3.2.22-37.el5.centos.noarch.rpm

Install it:
rpm -Uvh --force yum-3.2.22-37.el5.centos.noarch.rpm
Thats it.