Mysql won't start

This produced:
redirecting to systemctl
Job failed. See system logs and ‘systemctl status’ for details.

Tried: rcmysql start

but got an error telling this is not a valid way:

Failed to issue method call: Unit name rcmysql is not valid.

When searching the logs in /var/log/mysql I get in mysqld.log:

120610 01:37:19 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
a/usr/sbin/mysqld: File ‘./mysql-bin.index’ not found (Errcode: 13)
120610 1:37:19 [ERROR] Aborting

120610 1:37:19 [Note] /usr/sbin/mysqld: Shutdown complete

120610 01:37:19 mysqld_safe mysqld from pid file /var/lib/mysql/<user>.pid ended

And in mysql_upgrade.log I get:

Thu Jun 21 16:44:34 CEST 2012 - upgrading MySQL…

Will update MySQL now, if you encounter any problems, please read following file:
/usr/share/doc/packages/mysql-community-server/README.SuSE
Running protected MySQL…
Upgrading MySQL…
Looking for ‘mysql’ as: /usr/bin/mysql
Looking for ‘mysqlcheck’ as: /usr/bin/mysqlcheck
Running ‘mysqlcheck’ with connection arguments: ‘–port=3306’ ‘–socket=/var/run/mysql/mysql.sock’ ‘–socket=/var/tmp/mysql-protected.CRdqAN/mysql.sock’
Running ‘mysqlcheck’ with connection arguments: ‘–port=3306’ ‘–socket=/var/run/mysql/mysql.sock’ ‘–socket=/var/tmp/mysql-protected.CRdqAN/mysql.sock’
OLD.columns_priv
Error : Table ‘columns_priv’ is read only
status : Operation failed
OLD.db
Error : Table ‘db’ is read only
status : Operation failed
OLD.event
Error : Table ‘event’ is read only
status : Operation failed
OLD.func
Error : Table ‘func’ is read only
status : Operation failed
.
.
Error : Can’t find file: ‘./mysql/user.frm’ (errno: 13)
status : Operation failed

Repairing tables
OLD.columns_priv
Error : Table ‘columns_priv’ is read only
status : Operation failed
OLD.db
Error : Table ‘db’ is read only
status : Operation failed
OLD.event
Error : Table ‘event’ is read only
.
.
status : Operation failed
mysql.user
Error : Can’t find file: ‘./mysql/user.frm’ (errno: 13)
status : Operation failed
Running ‘mysql_fix_privilege_tables’…

From mysqld-upgrade-run.log:

120621 17:14:59 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
120621 17:14:59 InnoDB: The InnoDB memory heap is disabled
120621 17:14:59 InnoDB: Mutexes and rw_locks use GCC atomic builtins
120621 17:14:59 InnoDB: Compressed tables use zlib 1.2.5
120621 17:14:59 InnoDB: Initializing buffer pool, size = 128.0M
120621 17:14:59 InnoDB: Completed initialization of buffer pool
120621 17:14:59 InnoDB: highest supported file format is Barracuda.
120621 17:14:59 InnoDB: Waiting for the background threads to start
120621 17:15:00 InnoDB: 1.1.8 started; log sequence number 1595675
120621 17:15:00 [ERROR] /usr/sbin/mysqld: Can’t find file: ‘./mysql/time_zone_leap_second.frm’ (errno: 13)
120621 17:15:00 [Warning] Can’t open and lock time zone table: Can’t find file: ‘./mysql/time_zone_leap_second.frm’ (errno: 13) trying to live without them
120621 17:15:00 [ERROR] /usr/sbin/mysqld: Can’t find file: ‘./mysql/servers.frm’ (errno: 13)
120621 17:15:00 [ERROR] Can’t open and lock privilege tables: Can’t find file: ‘./mysql/servers.frm’ (errno: 13)
120621 17:15:00 [Note] /usr/sbin/mysqld: ready for connections.
Version: ‘5.5.25-log’ socket: ‘/var/tmp/mysql-protected.rgUz1k/mysql.sock’ port: 0 Source distribution
120621 17:15:00 [ERROR] /usr/sbin/mysqld: Can’t find file: ‘./mysql/columns_priv.frm’ (errno: 13)
.
.
120621 17:15:00 [ERROR] /usr/sbin/mysqld: Can’t find file: ‘./mysql/host.frm’ (errno: 13)
120621 17:15:00 [ERROR] Fatal error: Can’t open and lock privilege tables: Can’t find file: ‘./mysql/host.frm’ (errno: 13)
120621 17:15:00 [ERROR] /usr/sbin/mysqld: Can’t find file: ‘./mysql/servers.frm’ (errno: 13)
120621 17:15:00 [ERROR] Can’t open and lock privilege tables: Can’t find file: ‘./mysql/host.frm’ (errno: 13)
120621 17:15:00 [Note] /usr/sbin/mysqld: Normal shutdown

120621 17:15:01 InnoDB: Starting shutdown…
120621 17:15:01 InnoDB: Shutdown completed; log sequence number 1595675
120621 17:15:01 [Note] /usr/sbin/mysqld: Shutdown complete

120621 17:15:01 mysqld_safe mysqld from pid file /var/tmp/mysql-protected.rgUz1k/mysqld.pid ended
120621 18:37:04 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
120621 18:37:04 InnoDB: The InnoDB memory heap is disabled
120621 18:37:04 InnoDB: Mutexes and rw_locks use GCC atomic builtins
120621 18:37:04 InnoDB: Compressed tables use zlib 1.2.5
120621 18:37:04 InnoDB: Initializing buffer pool, size = 128.0M
120621 18:37:04 InnoDB: Completed initialization of buffer pool
120621 18:37:04 InnoDB: highest supported file format is Barracuda.
120621 18:37:04 InnoDB: Waiting for the background threads to start
120621 18:37:05 InnoDB: 1.1.8 started; log sequence number 1595675
120621 18:37:05 [Note] Recovering after a crash using mysql-bin
120621 18:37:05 [Note] Starting crash recovery…
120621 18:37:05 [Note] Crash recovery finished.
120621 18:37:05 [ERROR] /usr/sbin/mysqld: Can’t find file: ‘./mysql/time_zone_leap_second.frm’ (errno: 13)
120621 18:37:05 [Warning] Can’t open and lock time zone table: Can’t find file: ‘./mysql/time_zone_leap_second.frm’ (errno: 13) trying to live without them
120621 18:37:05 [ERROR] /usr/sbin/mysqld: Can’t find file: ‘./mysql/servers.frm’ (errno: 13)
120621 18:37:05 [ERROR] Can’t open and lock privilege tables: Can’t find file: ‘./mysql/servers.frm’ (errno: 13)
120621 18:37:05 [Note] /usr/sbin/mysqld: ready for connections.
Version: ‘5.5.25-log’ socket: ‘/var/tmp/mysql-protected.AXjsl8/mysql.sock’ port: 0 Source distribution
120621 18:37:05 [ERROR] /usr/sbin/mysqld: Can’t find file: ‘./mysql/columns_priv.frm’ (errno: 13)
.
.
120621 18:37:05 [ERROR] Fatal error: Can’t open and lock privilege tables: Can’t find file: ‘./mysql/host.frm’ (errno: 13)
120621 18:37:05 [ERROR] /usr/sbin/mysqld: Can’t find file: ‘./mysql/servers.frm’ (errno: 13)
120621 18:37:05 [ERROR] Can’t open and lock privilege tables: Can’t find file: ‘./mysql/host.frm’ (errno: 13)
120621 18:37:05 [Note] /usr/sbin/mysqld: Normal shutdown

120621 18:37:05 InnoDB: Starting shutdown…
120621 18:37:06 InnoDB: Shutdown completed; log sequence number 1595675
120621 18:37:06 [Note] /usr/sbin/mysqld: Shutdown complete

120621 18:37:06 mysqld_safe mysqld from pid file /var/tmp/mysql-protected.AXjsl8/mysqld.pid ended
120621 16:44:34 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
120621 16:44:34 InnoDB: The InnoDB memory heap is disabled
120621 16:44:34 InnoDB: Mutexes and rw_locks use GCC atomic builtins
120621 16:44:34 InnoDB: Compressed tables use zlib 1.2.5
120621 16:44:34 InnoDB: Initializing buffer pool, size = 128.0M
120621 16:44:34 InnoDB: Completed initialization of buffer pool
120621 16:44:34 InnoDB: highest supported file format is Barracuda.
120621 16:44:34 InnoDB: Waiting for the background threads to start
120621 16:44:35 InnoDB: 1.1.8 started; log sequence number 1595675
120621 16:44:35 [ERROR] /usr/sbin/mysqld: Can’t find file: ‘./mysql/time_zone_leap_second.frm’ (errno: 13)
120621 16:44:35 [Warning] Can’t open and lock time zone table: Can’t find file: ‘./mysql/time_zone_leap_second.frm’ (errno: 13) trying to live without them
120621 16:44:35 [ERROR] /usr/sbin/mysqld: Can’t find file: ‘./mysql/servers.frm’ (errno: 13)
120621 16:44:35 [ERROR] Can’t open and lock privilege tables: Can’t find file: ‘./mysql/servers.frm’ (errno: 13)
120621 16:44:35 [Note] /usr/sbin/mysqld: ready for connections.
Version: ‘5.5.25-log’ socket: ‘/var/tmp/mysql-protected.CRdqAN/mysql.sock’ port: 0 Source distribution
120621 16:44:35 [ERROR] /usr/sbin/mysqld: Can’t find file: ‘./mysql/columns_priv.frm’ (errno: 13)
120621 16:44:35 [ERROR] /usr/sbin/mysqld: Can’t find file: ‘./mysql/db.frm’ (errno: 13)
.
.

120621 16:44:35 [ERROR] /usr/sbin/mysqld: Can’t find file: ‘./mysql/servers.frm’ (errno: 13)
120621 16:44:35 [ERROR] Can’t open and lock privilege tables: Can’t find file: ‘./mysql/host.frm’ (errno: 13)
120621 16:44:36 [Note] /usr/sbin/mysqld: Normal shutdown

120621 16:44:36 InnoDB: Starting shutdown…
120621 16:44:36 InnoDB: Shutdown completed; log sequence number 1595675
120621 16:44:36 [Note] /usr/sbin/mysqld: Shutdown complete

120621 16:44:36 mysqld_safe mysqld from pid file /var/tmp/mysql-protected.CRdqAN/mysqld.pid ended

To be honest it really doen’t tell me much other than it probalby has something to do with file permissions.

From another site, that I have lost the link to, I tried this command with the following result.

ps -ef |grep mysqld
<user> 4100 4098 0 15:18 ? 00:00:01 /usr/sbin/mysqld --defaults-file=/home/<user>/.local/share/akonadi/mysql.conf --datadir=/home/<user>/.local/share/akonadi/db_data/ --socket=/home/raeghar/.local/share/akonadi/socket-raeghar/mysql.socket
root 8357 7789 0 16:48 pts/1 00:00:00 grep --color=auto mysqld

Tried to google some more, and stumbled on this thread:
http://forums.opensuse.org/forums/archives/sf-archives/archives-software/332504-where-mysql-sock.html

Tried to start it with: mysqld --user=mysql

And got the following result:

ysqld: Can’t find file: ‘./mysql/plugin.frm’ (errno: 13)
120621 18:25:54 [ERROR] Can’t open the mysql.plugin table. Please run mysql_upgrade to create it.
120621 18:25:54 InnoDB: The InnoDB memory heap is disabled
120621 18:25:54 InnoDB: Mutexes and rw_locks use GCC atomic builtins
120621 18:25:54 InnoDB: Compressed tables use zlib 1.2.5
120621 18:25:54 InnoDB: Initializing buffer pool, size = 128.0M
120621 18:25:54 InnoDB: Completed initialization of buffer pool
120621 18:25:54 InnoDB: highest supported file format is Barracuda.
120621 18:25:54 InnoDB: Waiting for the background threads to start
120621 18:25:55 InnoDB: 1.1.8 started; log sequence number 1595675
120621 18:25:55 [Note] Recovering after a crash using mysql-bin
120621 18:25:55 [Note] Starting crash recovery…
120621 18:25:55 [Note] Crash recovery finished.
120621 18:25:55 [Note] Server hostname (bind-address): ‘0.0.0.0’; port: 3306
120621 18:25:55 [Note] - ‘0.0.0.0’ resolves to ‘0.0.0.0’;
120621 18:25:55 [Note] Server socket created on IP: ‘0.0.0.0’.
120621 18:25:55 [ERROR] mysqld: Can’t create/write to file ‘/var/lib/mysql/<user>.pid’ (Errcode: 13)
120621 18:25:55 [ERROR] Can’t start server: can’t create PID file: Permission denied

From the top it looks like there is a lot of file mysql can’t find a lot of files, invluding the user pid file. Can’t find it at /var/lib/mysql however.

Any ideas how to fix this mess?

I have tried reinstalling several times, without it helping.

Please use CODE tags when posting computer text: http://forums.opensuse.org/english/information-new-users/advanced-how-faq-read-only/451526-posting-code-tags-guide.html
It will make clear boundaries between your story and the computer facts. It will maintain the white space layout of the original output, it will use a fixed size font, it will use scrolling to keep dimensions within resonable sizes, it will prevent smiley interpretation and URL interpretation, maybe more.

And then copy/paste prompt, command and output in one sweep of the mouse.

Few important questions :-

  • Which version of OpenSuSe you are using & x86 or 64 bit?
  • Which version of MySQL you are using? And x86 or 64 bit ]
  • Are you logged in as “root” and performing all commands?

Regards,
Amey.

For got to add that I’m using Opensuse 12.1 64 bit version.

Mysql version is 5.5.25-3.9.2_x86_64, and yes, I’m logged in as root.

To Henk:

Sorry, I used kwrite to write everything first, and copied it in as I’ve experienced on other boards that what
I’ve written have disappeared.

I didn’t think to add CODE tags to it before I posted.

On the link you sent there was an edit button togheter with the “reply” and “reply with quote”, but I can’t see
that option on my post, or else I would have fixed to formating error.

The CODE tags are for your future posts. It is of not much use to add them afterwards, as the computer formatting is then gone allready. You must copy/paste direct from your terminal session in between the CODE tags (or add the CODE tags manualy before and after the copied/pasted text, but only if freshly copied/pasted).

You can not edit your earlier posts (well, you can for about five or ten minutes to correct a typo), because editting posts would often make the whole thread ununderstandable to the new reader.

Ok, will do that from now on.

Still having problems with mysql however.

For some reason I have a mysqld.sock in /var/ . It’s empty, but neither

/var/run/mysql/mysqld.pid

or

/var/run/mysql/mysql.sock]

exist.

Tried to reinstall all mysql related programs in Yast with the Options -> Cleanup when removing packages option enabled.

Deleted all mysql files I could find. I have a backup of the databases themselves somewhere else. But the same errors are still there.

Anyone have a solution or point me in the right direction, because I’m about to give up, as I’ve got no ide how to fix this.

Definitely not the way to go. Throwing away files won’t help here, stronger even, you threw away mysql’s own database. Problem for me is, that I don’t understand how you got here. This should never ever happen on a default install. If this is on a new install, perform a reinstall. Then install the LAMP server pattern + phpMyAdmin. That will allow you to restore your databases in a graphical environment.