Go Back   CodingForums.com > :: Server side development > MySQL

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-07-2012, 08:55 PM   PM User | #1
Trax2k11
New Coder

 
Join Date: Apr 2011
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Trax2k11 is an unknown quantity at this point
Arrow SQL syntax

I'm moving a site over from another hosting company but when i'm uploading sql file i get the following error:

Quote:
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 '' at line 1
Seen has it says near line "1" i will post just the top few lines of the sql file

Code:
-- phpMyAdmin SQL Dump
-- version 3.5.2.2
-- http://www.phpmyadmin.net
--
-- Generation Time: Sep 06, 2012 at 02:26 PM
-- Server version: 5.5.27-28.0
-- PHP Version: 5.3.5

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `wbff_11001226_hubdir`
--

-- --------------------------------------------------------

--
-- Table structure for table `adminuser`
--

CREATE TABLE IF NOT EXISTS `adminuser` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` tinytext NOT NULL,
  `username` tinytext NOT NULL,
  `password` tinytext NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
Please note that i have no knowledge at all with mysql code etc.. So you will have to spell it out in plain english

Any help would be much appreciated.

PS: I can include the file if needed..
Trax2k11 is offline   Reply With Quote
Old 09-07-2012, 09:58 PM   PM User | #2
guelphdad
Super Moderator


 
guelphdad's Avatar
 
Join Date: Mar 2006
Location: St. Catharines, Ontario Canada
Posts: 2,629
Thanks: 4
Thanked 147 Times in 138 Posts
guelphdad will become famous soon enoughguelphdad will become famous soon enough
Pull any occurences of this out of the file before trying the import:

Code:
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
I think I remember that being the problem on some imports.

If not try removing everything up until this line:
Code:
-- Database: `wbff_11001226_hubdir`
guelphdad is offline   Reply With Quote
Old 09-07-2012, 11:41 PM   PM User | #3
Trax2k11
New Coder

 
Join Date: Apr 2011
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Trax2k11 is an unknown quantity at this point
Tried both your suggestions without any luck, i just get the same message.

Thanks though.
Trax2k11 is offline   Reply With Quote
Old 09-08-2012, 04:28 AM   PM User | #4
vroom
New Coder

 
Join Date: Sep 2012
Posts: 71
Thanks: 0
Thanked 8 Times in 8 Posts
vroom is an unknown quantity at this point
Have you checked to see if any of the import completed?
vroom is offline   Reply With Quote
Old 09-08-2012, 12:51 PM   PM User | #5
Trax2k11
New Coder

 
Join Date: Apr 2011
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Trax2k11 is an unknown quantity at this point
Yes, it does import all the tables and the import does complete, its not in phpmyadmin i get the error message. I see the message when i go to my website.

I'm going to attach the db file for anyone to look at, maybe they may see the problem?

Last edited by Trax2k11; 09-08-2012 at 03:55 PM..
Trax2k11 is offline   Reply With Quote
Old 09-08-2012, 03:04 PM   PM User | #6
guelphdad
Super Moderator


 
guelphdad's Avatar
 
Join Date: Mar 2006
Location: St. Catharines, Ontario Canada
Posts: 2,629
Thanks: 4
Thanked 147 Times in 138 Posts
guelphdad will become famous soon enoughguelphdad will become famous soon enough
Quote:
Originally Posted by Trax2k11 View Post
Yes, it does import all the tables and the import does complete, its not in phpmyadmin i get the error message. I see the message when i go to my website.
So then the error message has NOTHING to do with importing the file and will be an error in your php or whatever code you have on your web page.
guelphdad is offline   Reply With Quote
Old 09-08-2012, 03:53 PM   PM User | #7
Trax2k11
New Coder

 
Join Date: Apr 2011
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Trax2k11 is an unknown quantity at this point
So why would it then say on my web page?

Quote:
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 '' at line 1
Anyway ive managed to fix it by importing one table at a time until it screwed up again

Thanks for trying to help guys
Trax2k11 is offline   Reply With Quote
Old 09-08-2012, 11:36 PM   PM User | #8
guelphdad
Super Moderator


 
guelphdad's Avatar
 
Join Date: Mar 2006
Location: St. Catharines, Ontario Canada
Posts: 2,629
Thanks: 4
Thanked 147 Times in 138 Posts
guelphdad will become famous soon enoughguelphdad will become famous soon enough
It would say that on your web page because the error is in the PHP code doing the query and you are using mysql_error to report the query back to the web page.
guelphdad is offline   Reply With Quote
Reply

Bookmarks

Tags
error, mysql, syntax

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:34 AM.


Advertisement
Log in to turn off these ads.