Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

SQL error

Featured Replies

#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 '

-- 
-- Dumping data for table `wp_WPPortfolio_debuglog`
-- 

-- ----------' at line 1 

 

I am moving a database to another domain and I got this, what does this mean?

 

Thanks in advance, Alex!

Hello Alex,

 

Is the second domain on different server? as per the error it seems the mysql version on your first domain and second domain are different. Thats the reason you are getting this error. TO transfer database from once server to another server make sure that both mysql versions are same.

  • Author

What if they are not the same? How can I change one?

 

Thank you for the reply.

Its because you have an unescaped string using ' you need to find any unescaped quotes and escape them using \'

  • Author

I don't know anything about mySQL and never heard of that terminology, can you explain it a little more please?

  • Author

this is my new one

 

Error
SQL query:

-- 
-- Table structure for table `wp_WPPortfolio_debuglog`
-- 
CREATE TABLE  `wp_WPPortfolio_debuglog` (

`logid` BIGINT( 20 ) UNSIGNED NOT NULL AUTO_INCREMENT ,
`request_url` VARCHAR( 255 ) NOT NULL ,
`request_result` TINYINT( 4 ) NOT NULL DEFAULT  '0',
`request_detail` TEXT NOT NULL ,
`request_type` VARCHAR( 25 ) NOT NULL ,
`request_date` DATETIME NOT NULL ,
PRIMARY KEY (  `logid` )
) ENGINE = MYISAM DEFAULT CHARSET = utf8 AUTO_INCREMENT =1
MySQL said: 

#1046 - No database selected 

You need to tell it in which database to create the table, so at the top of that script you would put USE `my_database_name`;

  • Author

The top part of the script is now as follows, is this what you mean?

 

USE 'db354596548';
-- 
-- Table structure for table `wp_WPPortfolio_debuglog`
-- 

CREATE TABLE `wp_WPPortfolio_debuglog` (
 `logid` bigint(20) unsigned NOT NULL auto_increment,
 `request_url` varchar(255) NOT NULL,
 `request_result` tinyint(4) NOT NULL default '0',
 `request_detail` text NOT NULL,
 `request_type` varchar(25) NOT NULL,
 `request_date` datetime NOT NULL,
 PRIMARY KEY  (`logid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMEN

Yeah, not 100% sure but I think you need to use accents (`) instead of single quotes though.

 

USE `db354596548`;

  • Author

You was right because the one you supplied worked, although now I apparently have duplicate content:

 

SQL query:

-- --------------------------------------------------------
-- 
-- Table structure for table `wp_commentmeta`
-- 
CREATE TABLE  `wp_commentmeta` (

`meta_id` BIGINT( 20 ) UNSIGNED NOT NULL AUTO_INCREMENT ,
`comment_id` BIGINT( 20 ) UNSIGNED NOT NULL DEFAULT  '0',
`meta_key` VARCHAR( 255 ) DEFAULT NULL ,
`meta_value` LONGTEXT,
PRIMARY KEY (  `meta_id` ) ,
KEY  `comment_id` (  `comment_id` ) ,
KEY  `meta_key` (  `meta_key` )
) ENGINE = MYISAM AUTO_INCREMENT =7 DEFAULT CHARSET = utf8 AUTO_INCREMENT =7
MySQL said: 

#1050 - Table 'wp_commentmeta' already exists 

 

Should I delete it?

 

thank you for the help so far

Yeah i think your better dumping all of the old tables so you have a fresh db if one of your existing imports failed.

  • Author

The list kind of seems to be endless Ill delete that then a new table appears and this process keeps going, is there a list of tables so I can know what to delete or will I have to stick this out.

 

I would rather the data from the old database to be kept, this wont delete any will it?

The list kind of seems to be endless Ill delete that then a new table appears and this process keeps going, is there a list of tables so I can know what to delete or will I have to stick this out.

 

I would rather the data from the old database to be kept, this wont delete any will it?

 

Are you using phpmyadmin. are you deleting tables from the new database, if not then stop

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.