Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > General

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 16th December 2010, 15:46
dimas dimas is offline
Senior Member
 
Join Date: Jul 2006
Posts: 122
Thanks: 7
Thanked 25 Times in 6 Posts
Default Restoring MySQL databases from files.

I have a few questions I sincerely hope you'll help me with.

I had a hard disk crash on one of my servers running ISPConfig. I can't boot it. But having attached this hard disk to another computer I saw that most of the files are intact.

So I did a fresh install of ISPConfig 2.2.37 on a new hard disk drive (debian 5.0.7, perfect setup) and tried to manually restore some sites I didn't have fresh backups for.

Of course it went well with the files inside web/ but when it came to MySQL...

Well, that's what I did. I made a new db via the panel, and then copied the contents of /var/lib/mysql/old_db from the crashed disk to the corresponding /var/lib/mysql/new_db on the freshly installed server.

Then I changed permissions of all these .frm .myd .myi files to 660 (I didn't touch the directory) and changed ownership to mysql:mysql (which are the default permissions - as I can see looking at the other "naturally" created databases).

Then I rebooted and tried to load the site. Well, it didn't load, with MySQL error 1017, ER_FILE_NOT_FOUND

This made this thinking that something is still wrong with the permissions.

And indeed, when I chmodded the contents of /var/lib/mysql/new_db to 755, the site was finally up and running, seemingly without any problems.

So, my questions are:

1. Are 755 permissions inside /var/lib/mysql/ somehow compromising the server's security?
2. What is keeping MySQL from seeing the copied files, taking into account the fact that they have ABSOLUTELY the same permissions (user, group, read-write-execute rights)? Is there some other "subtle" permission layer?
Reply With Quote
Sponsored Links
  #2  
Old 17th December 2010, 10:24
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 34,586
Thanks: 792
Thanked 4,983 Times in 3,903 Posts
Default

1) I think 755 is ok.

2) Which table type do the database tables have? Myisam or innodb? Are you bale to see the database tables in phpmyadmin when you login as root?
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 17th December 2010, 11:27
dimas dimas is offline
Senior Member
 
Join Date: Jul 2006
Posts: 122
Thanks: 7
Thanked 25 Times in 6 Posts
Default

Thank you for your reply.

After I chmodded the files to 755 I could see the database tables in phpmyadmin when I logged in as the database user.

I can't check it as root now because something weird is happening with the server. I don't believe it's somehow connected to the yesterday's mysql experiments, though.

At the moment booting takes ages and I get "lockfile creation failed" error.
Reply With Quote
  #4  
Old 17th December 2010, 11:59
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 34,586
Thanks: 792
Thanked 4,983 Times in 3,903 Posts
Default

Check if the harrdisk is not full and if the harrdisk is mounted in read/write mode. You can check for boot errors with the command:

dmesg
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 17th December 2010, 12:28
dimas dimas is offline
Senior Member
 
Join Date: Jul 2006
Posts: 122
Thanks: 7
Thanked 25 Times in 6 Posts
Default

At the moment I can't get as far as login prompt, and there's no response over SSH.

The hard-disk is brand-new and has lots of free space.

Also, yesterday I rebooted the system multiple times and all was OK. Actually, I rebooted it last night before going to sleep (all was OK) and some time in the course of the night it became acting weirdly.

By the way - this situation probably justifies another topic, because right now I've noticed that my second Debian Lenny ISPConfig server (same configuration - ISPConfig 2.2.37, perfect setup, but totally diffrent hardware and even ISP) is also experiencing something similar. But I haven't done a thing to it for a few weeks at least!

When I saw that the services on this second server were down, I rebooted and it now takes ages to boot. At the moment it hangs for about 10 minutes at "Starting ISPConfig System..." but no errors yet.

I'm really at a loss now.

Could it be that some automatic update kills off Debian Lenny ISPConfig servers?
Reply With Quote
  #6  
Old 17th December 2010, 12:42
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 34,586
Thanks: 792
Thanked 4,983 Times in 3,903 Posts
Default

Quote:
Could it be that some automatic update kills off Debian Lenny ISPConfig servers?
ISPConfig has no automatic update functions. Also if this would be something that affects all ispconfiug 2 installs, then we would have seen here probably a few hundred posts on that as here. I run some ispconfig lenny servers on my own and they dont have any problems.

So if its a problem with a automatic update, then it must be something that you configured on your system outside of ispconfig.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #7  
Old 17th December 2010, 12:54
dimas dimas is offline
Senior Member
 
Join Date: Jul 2006
Posts: 122
Thanks: 7
Thanked 25 Times in 6 Posts
Default

Yes of course I realize that, and it's very strange. In fact, this second server has finally managed to boot fully, but it's painfully slow now and the services are not responding.

And I get the same type of errors as on the first server, namely:

task clamscan: 2492 blocked for more than 120 seconds
....
task apache2: 3350 blocked for more than 120 seconds

dmesg on this second server shows no errors that I can see.

All I did to the configuration over last few weeks was to

apt-get install libwww-perl
and
/home/admispconfig/ispconfig/tools/spamassassin/usr/bin/sa-update

because spamassasin wasn't working, as explained here:
http://www.howtoforge.com/forums/showthread.php?t=50468

Other than that it's 100% exact "perfect setup".

I don't think it's a hardware or Internet problem, because, as I said, the servers are totally different and have different ISP providers.

I'll try to find out what it is and post the outcome here - however right now I don't know where to start.
Reply With Quote
  #8  
Old 27th December 2010, 12:19
Captain Captain is offline
Senior Member
 
Join Date: Feb 2009
Posts: 271
Thanks: 75
Thanked 6 Times in 5 Posts
 
Default

Hi.
For security reasons /var/lib/mysql chmod will be 700

thnks.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL doesn't see databases BorderAmigos Server Operation 1 13th January 2010 02:07
Problems installing LAMP - MySQL and PHP5 JosBR Server Operation 5 19th December 2009 21:00
Debian 5.0 'hangs' GHz Installation/Configuration 5 1st October 2009 12:57
Connecting to mySQL databases timaaarrreee General 6 9th June 2008 09:58
Remote MySQL databases not created or available mastermindpro Installation/Configuration 12 19th May 2008 19:38


All times are GMT +2. The time now is 13:26.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.