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 'mysql.host' doesn't exist

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


any idea how to fix this?
rawandnetAsked:
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.

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

how did you upgrade from source ???


0

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
SwafnilCommented:
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
directory

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

--default-character-set=name
Set the default character set.

--character-sets-dir=path
Directory where character sets are.

--compress
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.

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

--shared-memory-base-name=name
Base name of shared memory.

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

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

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

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

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

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

--ssl-cipher=name
SSL cipher to use (implies --ssl).

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

--ssl-verify-server-cert
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

0
SoLostCommented:
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 :

http://dev.mysql.com/doc/refman/5.1/en/mysql-upgrade.html

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.
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

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

0
fosiul01Commented:
Check the permission under

/var/lib/mysql

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

my.cnf

it should be

datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock


0
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.
0
fosiul01Commented:
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 ??



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

tail -f /var/log/mysql.log
Error:
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 'mysql.host' doesn't exist
100422 18:14:12  mysqld ended
0
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
0
fosiul01Commented:
Can't open and lock privilege tables: Table 'mysql.host' doesn't exist

this error happen due to permission of test table..

0
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?
thanks

0
fosiul01Commented:
no problem, let me sent you an one of my tutorial.. follow it.. it will work 100% ,i always use it always

http://www.fosiul.com/index.php/2009/09/how-to-install-apache2-php-mysql-from-source/
0
rawandnetAuthor Commented:
thank you so much guys,
0
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.