Page 1 of 2
PleskMainDBException...help, I'm sooo lost
Posted: Tue Aug 15, 2006 2:23 pm
by wegngis
So, I ran an update to the Plesk base packages yesterday and now plesk is hosed. My websites running on mySQL are "mostly working" but some elements are not. At this point I am so turned around it's not even funny, so I'm begging for help! Here's what Plesk shows me when I try to log in:
Code: Select all
ERROR: PleskMainDBException
MySQL query failed: Can't open file: 'misc.ibd' (errno: 1)
0: /usr/local/psa/admin/plib/common_func.php3:234
db_query(string 'select param, val from misc')
1: /usr/local/psa/admin/plib/common_func.php3:471
get_param(string 'mysql41_compatible')
2: /usr/local/psa/admin/plib/common_func.php3:368
db_set_names()
3: /usr/local/psa/admin/plib/common_func.php3:347
db_connect_real(string 'localhost', string 'admin', string '********', string 'psa')
4: /usr/local/psa/admin/plib/common_func.php3:327
db_connect()
5: /usr/local/psa/admin/auto_prepend/auth.php3:85
Posted: Tue Aug 15, 2006 3:08 pm
by breun
Looks like your psa database is damaged. Please check if you didn't fill up your hard drive. You may be able to restore your psa database from /var/lib/psa/dumps.
Posted: Tue Aug 15, 2006 3:23 pm
by wegngis
Yes, one of the partitions did, in fact, fill up. There was an auto-backup that went rampant and filled up a 4GB partition. I cleaned it out and there is plenty of space now.
I've never had to restore the psa database. Should I be going after one of the mysql.daily.dump files?
Posted: Tue Aug 15, 2006 3:32 pm
by breun
You can use the most recent daily dump or the preupgrade dump. Just take the most recent dump before your system was hosed.
Posted: Tue Aug 15, 2006 4:14 pm
by wegngis
So, these daily dumps are mysql exports? If so, are they of all the databases on the system? Is there a way to just extract the psa database?
Posted: Tue Aug 15, 2006 4:32 pm
by wegngis
Ok, I just realized that this is probably just the psa database based on the fact of where it's dumping.
Posted: Tue Aug 15, 2006 4:57 pm
by breun
Yep, it's just the psa db. You can also just gunzip those files and open them in a text editor to see what they are.
Posted: Tue Aug 15, 2006 5:06 pm
by wegngis
Thanks for all your input. I tried to import, but no luck:
Code: Select all
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql -u admin -p psa < mysql.daily.dump.1' at line 1
I thought maybe I has to drop the psa database, but it won't let me do that either.
I'll take a look at the file right after I hit 'Submit'
Posted: Tue Aug 15, 2006 9:27 pm
by breun
You should be able to login using
mysql -uadmin -p`cat /etc/psa/.psa.shadow`. First drop the psa database (sorry, mod_security won't let me post the exact syntax for that operation on this forum, but it involves typing the words DROP, DATABASE and psa and finishing with a ';'). Quit (type quit) and then run:
Code: Select all
mysql -uadmin -p`cat /etc/psa/.psa.shadow` < mysql.daily.dump.0
The psa, mysql and horde db are backed up in those dumps, so you might get an error about not being able to restore the horde db. Just ignore it. If you want to restore your horde db, you'll have to drop it before the restore operation.
Posted: Tue Aug 15, 2006 10:10 pm
by wegngis
Well, I tried to drop the psa database (drop, database psa), but it wouldn't let me.
Code: Select all
ERROR 1051 (42S02): Unknown table forwarding,BackupsScheduled,dom_level_usrs,module_cs_gs_configs,dom_param,report,resp_freq,sa_conf,s'
So, I switch to the psa database & tried to drop the tables and it said they didn't exist.

Very frustrating.
(Commas inserted in syntax to get around mod_security)
Code: Select all
mysql> drop, table, forwarding;
ERROR 1051 (42S02): Unknown table 'forwarding'
Posted: Thu Aug 17, 2006 12:18 am
by wegngis
FINALLY figured it out. I solved the problem by deleting files/folders in the data portion of my MySQL installation. Once done, I could import the daily dump just fine.
Posted: Thu Aug 17, 2006 5:47 am
by breun
Yeah, those missing files might have made it hard to drop the db the regular way.

Glad to hear you figured it out (and remember backing up is a good thing).
Posted: Thu Aug 17, 2006 11:34 am
by wegngis
NOOOOO. When I rebooted the server it went back to being hosed.......what the heck is wrong with this machine????????
Posted: Thu Aug 17, 2006 11:52 am
by breun
Filled up the partition again?
Posted: Thu Aug 17, 2006 12:27 pm
by wegngis
No, at least plesk is reporting that it's about 50% full or so.