View Full Version : Mysql
phree
2007-07-29, 08:26 AM CDT
Hi,
I originaly got this error when starting the mysqld = chown: `mysql:mysql': invalid user
i changed ownership of the library to the my sql user then got a failed start.
I cannot get mysql to run/start. the following is a dump of the mysqld.log file. Anyone help??
070729 15:24:25 mysqld started
070729 15:24:25 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
070729 15:24:25 InnoDB: Starting log scan based on checkpoint at
InnoDB: log sequence number 0 43655.
InnoDB: Doing recovery: scanned up to log sequence number 0 43655
070729 15:24:25 InnoDB: Started; log sequence number 0 43655
070729 15:24:25 [ERROR] /usr/libexec/mysqld: Can't create/write to file '/var/run/mysqld/mysqld.pid' (Errcode: 13)
070729 15:24:25 [ERROR] Can't start server: can't create PID file: Permission denied
070729 15:24:25 mysqld ended
phree
2007-07-29, 09:08 AM CDT
So, I went through the log file and changed ownership on the various files it complained about
070729 16:01:54 mysqld started
070729 16:01:54 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'open'.
InnoDB: Cannot continue operation.
070729 16:01:54 mysqld ended
070729 16:03:04 mysqld started
070729 16:03:04 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ib_logfile0
InnoDB: File operation call: 'open'.
InnoDB: Cannot continue operation.
070729 16:03:04 mysqld ended
Which eventually led me to this message which i am not sure how to resolve. Can anyone tell me how to remove mysql completely and re-install from scratch. Yum leaves files behind which is the problem we are seeing. I need a complete remove and re-install but dont know how to acheive that with linux.
070729 16:04:17 mysqld started
070729 16:04:17 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
070729 16:04:17 InnoDB: Starting log scan based on checkpoint at
InnoDB: log sequence number 0 43655.
InnoDB: Doing recovery: scanned up to log sequence number 0 43655
070729 16:04:17 InnoDB: Started; log sequence number 0 43655
070729 16:04:17 [ERROR] /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
070729 16:04:17 [ERROR] /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
070729 16:04:17 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/host.frm' (errno: 13)
070729 16:04:17 mysqld ended
brunson
2007-07-29, 10:04 AM CDT
make sure the directory permissions on /var/lib/mysql/mysql allow the user mysql is running as to access them:
foxtrot(/var/lib/mysql)$ ls -l /var/lib/mysql
total 28788
-rw-rw---- 1 mysql mysql 18874368 2007-05-22 22:00 ibdata1
-rw-rw---- 1 mysql mysql 5242880 2007-05-22 22:00 ib_logfile0
-rw-rw---- 1 mysql mysql 5242880 2007-04-24 17:11 ib_logfile1
drwx------ 2 mysql mysql 4096 2007-03-29 09:56 mysql/
drwx------ 2 mysql mysql 4096 2007-03-29 11:30 test/
phree
2007-07-29, 10:18 AM CDT
Thanks Brunson.
Well i managed to remove the majority of the application and reinstall it. I can now start the demon but I cannot run mysql -u root and it wont let me create any databases. I get the follwing ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
I CAN log in with the default mysql user but when i run mysql> create database sqlgrey; i get the following error.
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'sqlgrey'
mysql>
I did as you asked, the output is below. I now just want to be able to removes the entire installation and redo from scratch. Is there a way to do that?????
-rw-rw---- 1 mysql mysql 10485760 2007-07-29 17:04 ibdata1
-rw-rw---- 1 mysql mysql 5242880 2007-07-29 17:06 ib_logfile0
-rw-rw---- 1 mysql mysql 5242880 2007-07-29 16:26 ib_logfile1
drwx------ 2 mysql mysql 4096 2007-07-29 16:34 mysql
srwxrwxrwx 1 mysql mysql 0 2007-07-29 17:06 mysql.sock
drwx------ 2 mysql mysql 4096 2007-07-29 16:17 test
brunson
2007-07-29, 11:29 AM CDT
If you installed from rpm, then use rpm to remove it and reinstall with yum. You may have to remove /var/lib/mysql. If you want, you can try removing /var/lib/mysql without removing the rpm, then using the /usr/bin/mysql_create_system_tables to recreate the database.
phree
2007-07-30, 04:52 AM CDT
brunson, thanks. I ended up deleting the /var/lib/mysql directory and then using yum to remove the various packages and dependencies. I then tried using yum to re-install but i just kept getting the same issues.
i then did the same directory delete and used the package manager to remove and add the mysql package and dependecies. I left it overnight before reconfiguring, i think i was getting to damn frustrated with it to do it last night.
I ssh'd into the box this morning, ran the setup, added the various passwords etc and it all worked first time, sod's law i guess. Spent 3hrs at it last night to no avail and then 10 minutes after a good nights sleep and bingo, all working.
rgds phree
brunson
2007-07-30, 09:15 AM CDT
We have a rule at my office: If it ain't fixed by 2am, it ain't gonna get fixed by morning, go home before you make it worse.
Glad you got it working.
vBulletin® v3.7.3, Copyright ©2000-2009, Jelsoft Enterprises Ltd.