Link to home
Start Free TrialLog in
Avatar of damixa
damixaFlag for Denmark

asked on

WordPress Migration SQL error

Hi,
Im trying to migrate servers for my Wordpress. I have done this previously and have succeeded fine. This time something seems to be going wrong and it is giving me the following error message
#1146 - Table 'happyd16_wrdp4.wp_commentmeta' doesn't exist

the code is
CREATE TABLE IF NOT EXISTS `wp_commentmeta` (
`meta_id` BIGINT( 20 ) UNSIGNED NOT NULL AUTO_INCREMENT ,
`comment_id` BIGINT( 20 ) UNSIGNED NOT NULL DEFAULT '0',
`meta_key` VARCHAR( 255 ) COLLATE utf8_unicode_ci DEFAULT NULL ,
`meta_value` LONGTEXT COLLATE utf8_unicode_ci,
PRIMARY KEY ( `meta_id` ) ,
KEY `comment_id` ( `comment_id` ) ,
KEY `meta_key` ( `meta_key` )
) ENGINE = INNODB DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci AUTO_INCREMENT =1;

Open in new window


thanks in advance,
Vinnie
Avatar of Jason C. Levine
Jason C. Levine
Flag of United States of America image

What happens if you just execute the above code independent of any import?
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of damixa

ASKER

a couple of other things
How are you doing the data migration?

- Are you dumping the database to an SQL script and then running that on the new server?

- Is happyd16_wrdp4 the name of the database on your new server or your old server?

wp_commentmeta is the first table in the WordPress list of tables - so I am guessing that the entire script is failing.

This could be that at the start of the script you have a

USE Database statement (Where database might be set to happyd16_wrdp4)

And this is the problem because your new database is called something else.

If there is a USE statement you can remove it and apply the script directly to your new database.

If this does not solve the problem then check that the user you are using to update the MySQL server has the rights to create tables.

I dont know if you feel comfortable of me accessing your server. If so, give me the info and I will gladly take a look.
Could you explain your last post ?
Avatar of magento
magento

Hi,

As JulianH stated, you should check the database name in both the servers.

Probabaly you need to replace the old name of db and the import should be just fine.

Thanks,
Magento
Avatar of damixa

ASKER

thanks