Skip to main content

plesk won't start after tweaking mysql

i've had this happen to me again the other week and as always, felt like kicking myself for not remembering.

we do a lot of performance tuning on mysql, and as a result, we almost always manage to get plesk mangled. not its fault, it just can't run without mysql, doh.

not of preference, but plesk happens to be there to make handling domains easier, as a single editing point when you want to change something and not worry about missing something out.

so there's a custom /etc/my.cnf that we use, and with changes to limits done (both on mysql and via ulimit), you'd think that a reload of mysqld would do. (we use InnoDB btw)

normally, that's all you need to have mysqld read off the new settings. if you've grown so dependent on plesk (like i have), you would not notice that mysqld didn't actually start, and you will get an error when you load plesk, thinking that it's a plesk error:


ERROR: PleskMainDBException
MySQL query failed: Incorrect information in file: './psa/misc.frm'

0: /usr/local/psa/admin/plib/common_func.php3:218
db_query(string 'select param, val from misc')
1: /usr/local/psa/admin/plib/common_func.php3:497
get_param(string 'mysql41_compatible')
2: /usr/local/psa/admin/plib/common_func.php3:394
db_set_names()
3: /usr/local/psa/admin/plib/common_func.php3:373
db_connect_real(string 'localhost', string 'admin', string '********', string 'psa')
4: /usr/local/psa/admin/plib/common_func.php3:353
db_connect()
5: /usr/local/psa/admin/auto_prepend/auth.php3:82

even a restart of the plesk service will not work:


[root@jedi]# /etc/init.d/psa restart
Unable to query parameter by query select val from misc where param='mysql41_compatible': Incorrect information in file: './psa/misc.frm'
Unable to query parameter by query select val from misc where param='mysql41_compatible': Incorrect information in file: './psa/misc.frm'
Mysql error: Incorrect information in file: './psa/key_history.frm'
Processing config directory: /usr/local/psa/admin/conf/httpsd.*.include
Syntax OK
/usr/local/psa/admin/bin/httpsdctl restart: httpd restarted
ERROR 1033 (HY000) at line 1: Incorrect information in file: './psa/sessions.frm'

so this is a mysqld failing to start properly problem. to fix this, go to your mysql datadir and see if the sizes of your innodb log files match those in your .cnf. we usually set innodb_log_file_size = 256M and innodb_log_buffer_size = 256M in /etc/my.cnf.

if they don't match, stop mysqld, remove the ib_logfile0 and ib_logfile1 files, and start mysqld. be careful not to delete the ibdata1 or ibdata2 files or you lose your data. avoid using rm -r ib* (yea, wildcards and fast fingers give sysads their most stupefying moments)

innodb will recreate the log files to match your .cnf and mysqld now becomes available for plesk.

Comments

Popular posts from this blog

Valentine Surprise

Each year, on Valentine's day, I usually surprise my darling wife with a letter/card, or a bouquet of roses. As it was a yearly thing, I knew she sort of expected these surprises; she'd look surprised, but I knew she wasn't really. Occasionally, she does get surprised. Like that time back in Cebu when I bought her a rather intricate bouquet of flowers. Her head spun when she found out how much I paid for it. Surprise! This year, however, is different. I was not able to prepare anything for her. I didn't get her anything, thinking that I'd just make up for it with dinner, or something. Yes, I didn't plan for this and I feel lousy actually. Last night, after my daughter gave me and my wife her home-made Valentine greeting cards, my wife started chiding me about what I was going to give her the next day. I gave her my usual "I'm not telling" smile and silently kicked myself. I wished I already had something ready, and I found myself already longing fo

Migs in the Office!

Miguel got real bored at home and wanted to go and meet his classmates. Since school doesn't start until the 7th, I decided to take him with me to the office. He immediately got busy with the miniclip games and ignored Mjolnir the whole time! [gallery type="rectangular" ids="3167,3166"]