Error message staring mysqld service

Hi Guys,

I have upgrade mysql 5.0 to 5.1, now when i try to start it it fail and get the following error:

100422 15:45:27 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

/usr/libexec/mysqld: Table 'mysql.plugin' doesn't exist

100422 15:45:27 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.

100422 15:45:27  InnoDB: Started; log sequence number 0 44233

100422 15:45:27 [ERROR] Fatal error: Can't open and lock privilege tables: Table '' doesn't exist

100422 15:45:27 mysqld_safe mysqld from pid file /var/run/mysqld/ ended

any idea how to fix this?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

check the permission of each directory.. make sure each directory has access for mysql user

how did you upgrade from source ???

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
yes, run "mysql_upgrade"! It's a command line tool located in your mysql's bin folder and can be used with a variety of parameters, you will most likely need the -u and -p when calling mysql_upgrade.
The rest of the tables will be installed/upgraded through the upgrade process.
- -?, --help
Display help message.

-b, --basedir=path
The path to the MySQL installation

-d, --datadir=path
The path to the data directory.

Set the default character set.

Directory where character sets are.

Use compression in server/client protocol.

-f, --force
Force execution of mysqlcheck even if mysql_upgrade has already been executed for the current version of MySQL.

-h, --host=name
Connect to host.

-p, --password[=name]
Password to use when connecting to server.

-W, --pipe
Use named pipes to connect to server.

-P, --port=name
Port number to use for connection.

The protocol of connection (tcp,socket,pipe,memory).

Base name of shared memory.

-S, --socket=name
Socket file to use for connection.

-u, --user=name
User for login if not current user.

Enable SSL for connection (automatically enabled with other flags). Disable with --skip-ssl.

CA file in PEM format (check OpenSSL docs, implies --ssl).

CA directory (check OpenSSL docs, implies --ssl).

X509 cert in PEM format (implies --ssl).

SSL cipher to use (implies --ssl).

X509 key in PEM format (implies --ssl).

Verify server's "Common Name" in its cert against hostname used when connecting. This option is disabled by default.

-v, --verbose
Display more output about the process 

Open in new window

I agree, as specified in the error message you should run the mysql_upgrade.  This is always advisable after upgrading a major revision like 5.0 - 5.1.  More information on this can be found in the following link :

It's normally a very straightforward and painless process.  However, I would normally do a mysqldump from v5.0, purge the database, upgrade to 5.1 and then re-import the data afterwards to ensure that the table structures are correct.
10 Holiday Gifts Perfect for Your Favorite Geeks

Still have some holiday shopping to do for the geeks in your life? While toys, clothing, games, and gift cards are still viable options for your friends and family, there’s more reason than ever to consider gadgets and software.

rawandnetAuthor Commented:
I have used (yum --enablerepo=remi install mysql-server mysql) to update mysql, the only reason i update mysql was because i upgraded php5.1 to php5.3, then I had to update php-mysql as well, this will require to upgrade mysql5.0 to 5.1 (do I have to update php-mysql 5.1 to 5.3, or shall i just leave it as it and will work)?

what folder shall i check for chmod permission?

mysql_upgrade give the following error:
[root@service~]# mysql_upgrade
Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
Running 'mysqlcheck with default connection arguments
mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) when trying to connect
FATAL ERROR: Upgrade failed

Check the permission under


all the directory should be

mysql:mysql and also check the permission for the table files aswell
and also check what is datadirectory and socket directory in


it should be


rawandnetAuthor Commented:
what happen was, I removed all mysql rpm packages, and i even deleted /var/lib/mysql/ folder and installed mysql using folloiwng command:
yum --enablerepo=remi install mysql mysql-server php-mysql

now i don't have /var/lib/mysql/mysql.sock file under my directory, I will reinstall the server and upgrade again. and will tell you what happen.
now i don't have /var/lib/mysql/mysql.sock file under my directory,

its because your mysql server is not running.

lets try to fix it before you delete

did you check all those informaiton as i asked ??

rawandnetAuthor Commented:
thanks for your grate help foxiul01, give me one minute  and will give you the detail error I am facing
rawandnetAuthor Commented:
service mysqld start

tail -f /var/log/mysql.log
100422 18:14:12  mysqld started
100422 18:14:12  InnoDB: Started; log sequence number 0 44233
100422 18:14:12 [ERROR] Fatal error: Can't open and lock privilege tables: Table '' doesn't exist
100422 18:14:12  mysqld ended
rawandnetAuthor Commented:
Ignore above messages, i have reinstalled new server and upgraded mysql 5.0 to 5.1 and php 5.1 to 5.3, lets wait until finishes, i will tell you what happened
Can't open and lock privilege tables: Table '' doesn't exist

this error happen due to permission of test table..

rawandnetAuthor Commented:
I fixed that by reinstalling redhat linux, and installing mysql through remi, but tomorrow i will try compiling php mysql apache, if i had problem I will ask you to help me out, if you don't mine?

no problem, let me sent you an one of my tutorial.. follow it.. it will work 100% ,i always use it always
rawandnetAuthor Commented:
thank you so much guys,
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Distributions

From novice to tech pro — start learning today.