Web Design Forum: SQL error - Web Design Forum

Jump to content

WDF
WDF Premium Memberships Reseller Hosting
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

SQL error #1064

#1 User is offline   Alex_McI 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 221
  • Joined: 24-April 08
  • Reputation: 0
  • Gender:Male
  • Experience:Advanced
  • Area of Expertise:Designer/Coder

Posted 14 January 2011 - 02:50 PM

#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!
0

#2 User is offline   UK Web hosting 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 287
  • Joined: 02-January 10
  • Reputation: 9
  • Gender:Male
  • Location:UK
  • Experience:Nothing
  • Area of Expertise:Nothing

Posted 17 January 2011 - 06:21 AM

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.
0

#3 User is offline   Alex_McI 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 221
  • Joined: 24-April 08
  • Reputation: 0
  • Gender:Male
  • Experience:Advanced
  • Area of Expertise:Designer/Coder

Posted 17 January 2011 - 09:34 AM

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

Thank you for the reply.
0

#4 User is online   Jock 

  • like a boss
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,476
  • Joined: 15-May 10
  • Reputation: 246
  • Gender:Male
  • Location:Scotland

Posted 17 January 2011 - 10:05 AM

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

#5 User is offline   Alex_McI 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 221
  • Joined: 24-April 08
  • Reputation: 0
  • Gender:Male
  • Experience:Advanced
  • Area of Expertise:Designer/Coder

Posted 17 January 2011 - 10:58 AM

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

#6 User is offline   Alex_McI 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 221
  • Joined: 24-April 08
  • Reputation: 0
  • Gender:Male
  • Experience:Advanced
  • Area of Expertise:Designer/Coder

Posted 17 January 2011 - 11:00 AM

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 

0

#7 User is online   Jock 

  • like a boss
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,476
  • Joined: 15-May 10
  • Reputation: 246
  • Gender:Male
  • Location:Scotland

Posted 17 January 2011 - 11:22 AM

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`;
0

#8 User is offline   Alex_McI 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 221
  • Joined: 24-April 08
  • Reputation: 0
  • Gender:Male
  • Experience:Advanced
  • Area of Expertise:Designer/Coder

Posted 17 January 2011 - 12:05 PM

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

0

#9 User is online   Jock 

  • like a boss
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,476
  • Joined: 15-May 10
  • Reputation: 246
  • Gender:Male
  • Location:Scotland

Posted 17 January 2011 - 12:13 PM

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

USE `db354596548`;

0

#10 User is offline   Alex_McI 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 221
  • Joined: 24-April 08
  • Reputation: 0
  • Gender:Male
  • Experience:Advanced
  • Area of Expertise:Designer/Coder

Posted 17 January 2011 - 12:45 PM

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
0

#11 User is online   Jock 

  • like a boss
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,476
  • Joined: 15-May 10
  • Reputation: 246
  • Gender:Male
  • Location:Scotland

Posted 17 January 2011 - 01:06 PM

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

#12 User is offline   Alex_McI 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 221
  • Joined: 24-April 08
  • Reputation: 0
  • Gender:Male
  • Experience:Advanced
  • Area of Expertise:Designer/Coder

Posted 17 January 2011 - 01:24 PM

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?
0

#13 User is offline   pat24 

  • Guru of nothing important!!
  • PipPipPipPipPip
  • Group: Members
  • Posts: 2,183
  • Joined: 29-April 08
  • Reputation: 131
  • Gender:Male
  • Experience:Intermediate
  • Area of Expertise:Web Developer

Posted 17 January 2011 - 01:27 PM

View PostAlex_McI, on 17 January 2011 - 01:24 PM, said:

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
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users