After updating to the latest version, I have multiple occurrence of errors in the PHP error log like:
Specified key was too long; max key length is 1000 bytes
ALTER TABLE wp_mec_users
ADD PRIMARY KEY (id
), ADD UNIQUE KEY email
(email
);
Incorrect table definition; there can be only one auto column and it must be defined as a key
ALTER TABLE wp_mec_users
MODIFY id
int NOT NULL AUTO_INCREMENT;
Multiple primary key defined
ALTER TABLE wp_mec_occurrences
ADD PRIMARY KEY (id
), ADD KEY post_id
(post_id
), ADD KEY occurrence
(occurrence
);
What do you suggest?
Thanks
]]>These SQL errors are presented below.
How do I fix this?
WordPress database error: [Unknown column ‘cat’ in ‘where clause’]
select count(*) as cnt from wp_WP_SEO_Redirection
where cat=’link’ and grpID=1
select count(*) as cnt from wp_WP_SEO_Redirection
where cat=’link’ and grpID=2
select count(*) as cnt from wp_WP_SEO_Redirection
where cat=’link’ and grpID=3
select count(*) as cnt from wp_WP_SEO_Redirection where cat=’link’ and blog=’1′ and redirect_from_type <> ‘Replace’ order by ID desc
select ID, redirect_from, redirect_from_type, enabled, redirect_to, redirect_to_type, redirect_type, (SELECT count(ID) FROM wp_WP_SEO_Redirection_LOG where rfrom
= redirect_from and rto
= redirect_to ) as redirect_hits, (SELECT ctime
FROM wp_WP_SEO_Redirection_LOG where rfrom
= redirect_from and rto
= redirect_to order by ctime
desc limit 1) as redirect_last_access from wp_WP_SEO_Redirection where cat=’link’ and blog=’1′ and redirect_from_type <> ‘Replace’ order by ID desc limit 0,10
WordPress database error: [Unknown column ‘blog’ in ‘where clause’]
delete from wp_WP_SEO_404_links where blog=’1′ and link=’blog.sohnen-moe.com/’
WordPress database error: [Unknown column ‘blog’ in ‘where clause’]
select redirect_from from wp_WP_SEO_Redirection where blog=’1′ and redirect_from=’blog.sohnen-moe.com/’ and cat=’link’
WordPress database error: [Unknown column ‘grpID’ in ‘field list’]
insert into wp_WP_SEO_Redirection(enabled,grpID,redirect_from_type,redirect_from_folder_settings,redirect_from_subfolders,redirect_to_type,redirect_to_folder_settings,redirect_type,redirect_from,redirect_to,cat,regex,blog) values(‘1′,’1′,’EndWith’,’1′,’0′,’Page’,”,’301′,’blog.sohnen-moe.com/’,’/blog/’,’link’,’^.*blog\\.sohnen\\-moe\\.com\\/$’,’1′)
Warning: mysql_real_escape_string(): Access denied for user ”@’localhost’ (using password: NO) in /home/steveohs/public_html/wp-content/plugins/easy-contact-forms/easy-contact-forms-database.php on line 152
Warning: mysql_real_escape_string(): A link to the server could not be established in /home/steveohs/public_html/wp-content/plugins/easy-contact-forms/easy-contact-forms-database.php on line 152
So I tried logging in and I cannot log in either as it says this above my login:
ERROR: Cookies are blocked due to unexpected output. For help, please see this documentation or try the support forums.
And this at the top of my login page
Warning: mysql_real_escape_string(): Access denied for user ”@’localhost’ (using password: NO) in /home/steveohs/public_html/wp-content/plugins/easy-contact-forms/easy-contact-forms-database.php on line 152
Warning: mysql_real_escape_string(): A link to the server could not be established in /home/steveohs/public_html/wp-content/plugins/easy-contact-forms/easy-contact-forms-database.php on line 152
Warning: Cannot modify header information – headers already sent by (output started at /home/steveohs/public_html/wp-content/plugins/easy-contact-forms/easy-contact-forms-database.php:152) in /home/steveohs/public_html/wp-login.php on line 387
Warning: Cannot modify header information – headers already sent by (output started at /home/steveohs/public_html/wp-content/plugins/easy-contact-forms/easy-contact-forms-database.php:152) in /home/steveohs/public_html/wp-login.php on line 400
I don’t know what happened, I haven’t changed anything in a long time
Any Help would be very appreciated! My website is steveohsredstone.com
]]>WordPress database error: [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 ') AND post_type='job_listing' AND menu_order=0' at line 1]
UPDATE wp_posts SET menu_order = 1 WHERE ID NOT IN () AND post_type='job_listing' AND menu_order=0;
WordPress database error: [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 ') AND post_type='job_listing'' at line 1]
UPDATE wp_posts SET menu_order = 0 WHERE ID IN () AND post_type='job_listing';
A chance this was on my localhost website and that I always set the debug var to true. I didn’t test if anything was changed about the fact to post jobs. I guess you should check it ASAP.
https://www.ads-software.com/plugins/wp-job-manager/
]]>query($sql); } ?>
set_data_source($table_prefix . 'user_login_history'); $grid->add_select_field('Status'); $grid->set_order('ID desc'); $grid->pagination->set_rows(15); $grid->set_table_attr('width','100%'); $grid->set_col_attr(1,'align','center'); //$grid->set_col_attr(3,'width','100'); $grid->add_html_col("",'Status'); $grid->add_data_col('Username','Username'); $grid->add_data_col('Name','Name'); $grid->add_data_col('Usertype','User type'); $grid->add_data_col('Sinon_time','Date & Time'); $grid->add_data_col('logged_out_time','Logged out'); $grid->add_data_col('Country','Country'); $grid->add_data_col('IP','IP'); $grid->add_data_col('OS','OS'); $grid->add_data_col('Browser','Browser'); $grid->run(); ?>
and
= 3) { $newoptions['login_max_trials']= intval($_POST['login_max_trials']); }else { $newoptions['login_max_trials']=$options['login_max_trials']; $saved_options = $saved_options . "
Note that 'Login Blocker Trials' does not changed because it must be 3 or greater!"; } if( intval($_POST['login_block_time']) >= 3) { $newoptions['login_block_time']= intval($_POST['login_block_time']); }else { $newoptions['login_block_time']=$options['login_block_time']; $saved_options = $saved_options . "
Note that 'Login Blocker Time' does not changed because it must be 3 or greater!"; } WPS_update_my_options($newoptions); WPS_option_msg($saved_options); } $options= WPS_my_options(); ?>
Any ideas how to fix?
https://www.ads-software.com/plugins/wp-login-security-and-history/
]]>While these are normal SQL messages that depict a runaway process, in my own log files these messages are most often associated with Brute Force Dictionary attacks that are trying to get into the WordPress admin accounts.
You can tell because they are piling up errors rapidly from unknown IP addresses (often the same IP address makes many attempts).
Have been using IP blocking to prevent unauthorized access to the admin accounts (server level, in forums, and in blogs).
Have also been renaming login pages so the bots cannot find them.
Not all my admin accounts are called “admin”; they’ll try a random list of possible user names, too. Hence, renaming “admin” user is pretty much a waste of time if you have published any content as that user.
Have also implemented a universal “DENY ALL” for wp-login.php (which no longer exists on my blogs) in .htaccess.
The bots won’t stop because you rename stuff. So I’m not sure what they’re doing to trigger these SQL errors. The referrer data they provide is faked.
Here is the first entry for one IP address in one of my logfiles:
[Tue Oct 08 05:02:51 2013] [error] [client 37.59.18.34] WordPress database error Lost connection to MySQL server during query for query SELECT autoload FROM wp_options WHERE option_name = ‘_transient_doing_cron’ made by require(‘wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’), require_once(‘wp-settings.php’), do_action(‘init’), call_user_func_array, wp_cron, spawn_cron, get_transient, delete_option
It looks like the attack began about 1 minute before that particular entry but I cannot be sure.
Does anyone know which WordPress scripts would trigger this kind of error? I suspect it’s coming from one of these plugins, which are common to all the blogs being attacked:
AKISMET
LIMIT LOGIN ATTEMPTS
RENAME WP-LOGIN.PHP
STOP FORUM SPAMMERS
I am pretty sure it’s not “RENAME WP-LOGIN.PHP” as I only started using that plugin a little over a week ago and these attacks have been going on for months.
I don’t know enough about WordPress’ interactions with PHP and SQL to really understand what is going awry. But further on in the log file I do see that attempts to connect from LIMIT LOGIN ATTEMPTS are failing. Maybe this is all due to that one plugin being overwhelmed, but I can’t see what is going wrong. The error messages are associated with different SQL functions, not just attempts to add spammer IDs to the database.
The BFDs are not just targeting WordPress. They are also going after server-level admin access to Telnet, Dovecot (email), and FTP services. I disable these services when I don’t need them. And we have a VBulletin forum that is also blocking automated registrations. We also use a Linux firewall to block all access from malicious IPs (mostly in Asia and eastern Europe) so there are no logs for that activity once an IP address is added to the firewall.
Any suggestions on what the WordPress/SQL issue may be will be appreciated.
]]>The sad tale: We had free hosting from a friend. The friend left her job, and then, eventually the host went under. We lost our blog. We restored from a six month old backup (all we had).
When we managed to get in touch with the server’s new owner, he very kindly exported the mysql database to a sql file and let us have it. Awesome.
But when I go in through phpmyadmin to upload the old database (I figured I’d export the new entries, replace the database with the one we’d lost, then use wordpresses import functionality to get the recent entries back in) I get the following error. Any ideas?
Error
SQL query:
/*!40000 ALTER TABLE
wp_comments
DISABLE KEYS */;MySQL said: Documentation
#2006 – MySQL server has gone away
Help!?
Thanks
]]>I’m seeing a rather strange set of SQL errors cropping up every time I publish or edit a post using Windows Live Writer 2008. I believe these errors began when I updated to WordPress version 2.3.2 and I still get them since updating to 2.3.3. These are the errors that show up in my root directory error log. It’s the same set each time I publish or edit:
[16-Feb-2008 11:26:51] WordPress database error MySQL server has gone away for query SELECT * FROM wp_posts, wp_postmeta WHERE wp_posts.ID = wp_postmeta.post_id AND wp_postmeta.meta_key = ‘_pingme’ LIMIT 1
[16-Feb-2008 11:26:51] WordPress database error MySQL server has gone away for query SELECT * FROM wp_posts, wp_postmeta WHERE wp_posts.ID = wp_postmeta.post_id AND wp_postmeta.meta_key = ‘_encloseme’ LIMIT 1
[16-Feb-2008 11:26:51] WordPress database error MySQL server has gone away for query SELECT ID FROM wp_posts WHERE CHAR_LENGTH(TRIM(to_ping)) > 7 AND post_status = ‘publish’
[16-Feb-2008 11:26:51] WordPress database error MySQL server has gone away for query UPDATE wp_options SET option_value = ‘0’ WHERE option_name = ‘doing_cron’
The kicker is that Windows Live Writer publishes with no problem at all and the posts show up just fine like they always have and I never would have noticed these errors if I wasn’t in the habit of checking my error logs on a regular basis.
Currently I have pinging turned off in both my admin and Windows Live Writer but that hasn’t made any difference and so far deactivating various plugins hasn’t made a difference either. Considering that I was running the same group of plugins before this problem arose it seems rather doubtful that it’s a plugin related problem.
Unfortunately I’m SQL light and admittedly don’t have a clue of where to go with this. I’ve already talked with Joe Cheng (WLW developer) about the problem and this is the first time he’s heard of it and recommended posting here. Any help would be thankfully appreciated.
Running:
Windows Live Writer: Publishing in XHTML
PHP: 5.2.5
MySQL: 5.0.45
]]>[26-Jan-2008 15:06:51] WordPress database error 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 ‘AND comment_approved = ‘1’ ORDER BY comment_date_gmt DESC LIMIT 5′ at line 1 for query SELECT wp_comments.* FROM wp_comments WHERE comment_post_ID = AND comment_approved = ‘1’ ORDER BY comment_date_gmt DESC LIMIT 5
This all started happening about the time I upgraded to the latest version of Akismet but I have no way to tell if this is actually the problem or not. I suppose I could switch over to Defensio just to check to see if that stopped this from happening but I wanted to throw it out to the community first to see if anyone has ever seen this before. I know I haven’t.
I’m running 2.3.2 on PHP 5.2.5, SQL 5.0.45
This is usually a clean running install and has been for close to two years now but this has got me stumped. The database tables are “OK” when checked and I optimize once a week.
Any help?
]]>