I broke mysql, but have a backup...

Problems with the Linux version of XAMPP, questions, comments, and anything related.

I broke mysql, but have a backup...

Postby joshb » 14. May 2009 16:42

Hi everyone,

First of all, im new to linux which didnt help...the person who installed the server set it up with xampp.

Earlier I was attempting to allow root access to mysql for all hosts (no real security issue...its a local test server) so I could connect the MySql Tools to it. When I changed it in phpmyadmin though, i told it to delete the previous account and create a new one. This then caused me to be unable to access all my data.

I googled around a bit and found a few sites with similar issues, but none of their solutions worked. In fact, one of them made it worse (not sure which one) - Logging into phpmyadmin now returns the following error:
#2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)

and through command line:
# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'

I have tried restarting mysqld via RHEL5's Service Configuration, but nothing has changed.

I was trying to follow instructions at http://dev.mysql.com/doc/refman/5.1/en/ ... sions.html , logged into the server as root, so needed to use the /opt/lampp/sbin/mysqld --user=mysql. This caused the following error:
InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have teh access rights to
InnoDB: the directory.
InnoDB: File name /opt/lampp/var/mysql/ibdata1
InnoDB: File operation call: 'open'.
InnoDB: Cannot continue operation.

(/opt/lampp/var/mysql/ibdata1 doesnt exist...)

Before this I tried renaming /opt/lampp/var/mysql/mysql/ and putting a backup I had in its place - forgetting about linux's permissions system...I then deleted it and put the name back.

So, I was wondering whether I could use a recent backup to fix this? I have the entire /opt/lampp backed up so can get any file xampp should require. Ideally I would just restore the database permissions - what do I need to replace to achive this? Also, what file permissions should be used? Oh, and since the backup I created a new database which is quite large - I cant use mysqldump because mysql seems dead, but have the folder and all the frm myd myi etc files - would I still be able to use this after restoring the backup?


Posts: 4
Joined: 14. May 2009 16:12

Re: I broke mysql, but have a backup...

Postby joshb » 15. May 2009 10:11

Fixed it! Had a look at it this morning and realised what I was doing yesterday - using mysql that came bundled with the distribution, rather than the /opt/lampp/bin/mysql etc.

Started the server using the commands on the link i posted, reset the root account, then replaced /opt/lampp/var/mysql/mysql with a backup I had, restarted the server with normal settings and everythings working again!

Thanks anyway,
Posts: 4
Joined: 14. May 2009 16:12

Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 5 guests