Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Error importing database from local to live server (error #1881)

Hi all,

I'm attempting to import a Wordpress site from my local server (using MAMP) into a new database on a live server.

Here are the steps I took:

1) Drag Wordpress files onto live server via FTP

2) Export local database as .sql file

3) Import database onto live server

I've done this before without a hitch, but this time I'm getting this error:

SQL query:

--
-- Dumping data for table `wp_comments`
--
INSERT INTO  `wp_comments` (  `comment_ID` ,  `comment_post_ID` ,  `comment_author` ,  `comment_author_email` ,  `comment_author_url` ,  `comment_author_IP` , `comment_date` ,  `comment_date_gmt` ,  `comment_content` ,  `comment_karma` ,  `comment_approved` ,  `comment_agent` ,  `comment_type` ,  `comment_parent` , `user_id` ) 
VALUES ( 1, 1,  'Mr WordPress',  '',  'https://wordpress.org/',  '',  '2014-12-02 06:30:10',  '2014-12-02 06:30:10', 'Hi, this is a comment.\nTo delete a comment, just log in and view the post's comments. There you will have the option to edit or delete them.', 0,  '1',  '',  '', 0, 0 ) ;


MySQL said: Documentation

#1881 - Operation not allowed when innodb_forced_recovery > 0. 

I've tried deleting & recreating the live database several times, but the error is the same each time.

I've also tried several different options when exporting the backup from the local server.

Any ideas? Thanks in advance!

1 Answer

Your database is in read only mode. You have to set innodb_force_recovery to 0 in a config file before you can insert data.

http://stackoverflow.com/questions/25155777/operation-not-allowed-when-innodb-forced-recovery-0-sqlyog

http://dev.mysql.com/doc/refman/5.0/en/forcing-innodb-recovery.html

Thank you Michael, I think that was indeed the issue! The hosting company helped me out, now I know what to do if I run into that again :)