MySQL/Database error when moving WordPress hosts.
-
Hello everyone,
I have backed up all my wordpress files and databases of my wordpress blog so I can import these to my new host. Everything is going fine and have edited all the code to make the blog work on the new urls etc. I have created a different database with different details than my old one in phpMyAdmin and am trying to import .sql file to my new database. Although, when I upload it mid-way through I get this error:
SQL query:
?– phpMyAdmin SQL Dump
— version 2.8.0.1
— https://www.phpmyadmin.net
—
— Host: custsql-ipg06.eigbox.net
— Generation Time: Oct 09, 2012 at 06:44 AM
— Server version: 5.0.91
— PHP Version: 4.4.9
—
— Database:wrd_4dhogad2nn
—
— ——————————————————–
—
— Table structure for tablewp_commentmeta
—
DROP TABLE IF EXISTSwp_commentmeta
;MySQL said:
#1064 – 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 ‘???
DROP TABLE IF EXISTS
wp_commentmeta
‘ at line 1I have no idea what the problem is, and to be honest: I have editted something at the top since I was having a different error. To make life easier I will post the top bit of the original unedited .sql file that I backed up and also the new one I editted.
Orignal back-up (unedited):
-- phpMyAdmin SQL Dump -- version 2.8.0.1 -- https://www.phpmyadmin.net -- -- Host: custsql-ipg06.eigbox.net -- Generation Time: Oct 09, 2012 at 06:44 AM -- Server version: 5.0.91 -- PHP Version: 4.4.9 -- -- Database: <code>wrd_lh1dkh37gb</code> -- CREATE DATABASE <code>wrd_lh1dkh37gb</code> DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci; USE <code>wrd_lh1dkh37gb</code>; -- -------------------------------------------------------- -- -- Table structure for table <code>wp_commentmeta</code> -- DROP TABLE IF EXISTS <code>wp_commentmeta</code>; CREATE TABLE IF NOT EXISTS <code>wp_commentmeta</code> ( <code>meta_id</code> bigint(20) unsigned NOT NULL auto_increment, <code>comment_id</code> bigint(20) unsigned NOT NULL default '0', <code>meta_key</code> varchar(255) default NULL, <code>meta_value</code> longtext, PRIMARY KEY (<code>meta_id</code>), KEY <code>comment_id</code> (<code>comment_id</code>), KEY <code>meta_key</code> (<code>meta_key</code>) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; -- -- Dumping data for table <code>wp_commentmeta</code> -- -- -------------------------------------------------------- --
And here is the edited version:
-- phpMyAdmin SQL Dump -- version 2.8.0.1 -- https://www.phpmyadmin.net -- -- Host: custsql-ipg06.eigbox.net -- Generation Time: Oct 09, 2012 at 06:44 AM -- Server version: 5.0.91 -- PHP Version: 4.4.9 -- -- Database: <code>wrd_4dhogad2nn</code> -- -- -------------------------------------------------------- -- -- Table structure for table <code>wp_commentmeta</code> -- DROP TABLE IF EXISTS <code>wp_commentmeta</code>; CREATE TABLE IF NOT EXISTS <code>wp_commentmeta</code> ( <code>meta_id</code> bigint(20) unsigned NOT NULL auto_increment, <code>comment_id</code> bigint(20) unsigned NOT NULL default '0', <code>meta_key</code> varchar(255) default NULL, <code>meta_value</code> longtext, PRIMARY KEY (<code>meta_id</code>), KEY <code>comment_id</code> (<code>comment_id</code>), KEY <code>meta_key</code> (<code>meta_key</code>) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; -- -- Dumping data for table <code>wp_commentmeta</code> -- -- -------------------------------------------------------- --
The reason for me editing the file was because an error popped-up saying that I cannot create a new database, as you can see in the first few lines the .sql commands to make a new database with the following details. Although the host only allows databases to be created through their panel. So I editted this tiny bit out so it would only import the tables.
THE PROBLEM IS: To be honest, this was the first time of me editing .sql files therefore I am unsure whether I have done it the right way or not. And I am most certain that this may have caused the problem.
So is there anyone expert out here that can help me out please! I would be hugely thankful! Thanks for your time.
Regards,
Shad
- The topic ‘MySQL/Database error when moving WordPress hosts.’ is closed to new replies.