[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

MySQL - phpMyAdmin - syntax error 1064 when trying to import database

Posted on 2007-03-21
6
Medium Priority
?
1,978 Views
Last Modified: 2013-12-13
Using phpMyAdmin I have exported a database from one server (php version 5.0.4) and want to import it onto a new server (php version 5.0.37) but when I import it I get an error message as follows:


Error
SQL query:

-- phpMyAdmin SQL Dump
-- version 2.6.0-pl3
-- http://www.phpmyadmin.net
--
-- Host: mysql4db.gradwell.net
-- Generation Time: Mar 21, 2007 at 12:51 PM
-- Server version: 4.1.10
-- PHP Version: 5.0.4
--
-- Database: `smallbone`
--
-- --------------------------------------------------------
--
-- Table structure for table `admin_user`
--
CREATE TABLE  `admin_user` (
 `user_name` tinytext NOT NULL ,
 `user_pass` tinytext NOT NULL ,
 `user_id` smallint( 6 ) NOT NULL AUTO_INCREMENT ,
 `type` tinyint( 4 ) NOT NULL default  '0',
KEY  `user_id` (  `user_id` )
) TYPE = MYISAM DEFAULT CHARACTER SET = latin1 AUTO_INCREMENT =3;


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 'user_name` tinytext NOT NULL,
  `user_pass` tinytext NOT NULL,
  `user_id` small' at line 1




I don't know enough PHP/SQL to solve this! Help!
Thank you.
0
Comment
Question by:bbourgeaux
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 14

Expert Comment

by:Aamir Saeed
ID: 18765366
try

CREATE TABLE  `admin_user` (
 `user_name` tinytext NOT NULL ,
 `user_pass` tinytext NOT NULL ,
 `user_id` smallint( 6 ) NOT NULL AUTO_INCREMENT ,
 `type` tinyint( 4 ) NOT NULL default  '0',
KEY  `user_id` (  `user_id` )
)
0
 

Author Comment

by:bbourgeaux
ID: 18765469
Thanks for your quick answer but it didn't work. I get the exact same error message.
0
 
LVL 28

Expert Comment

by:gamebits
ID: 18768890
What version of mysql are you using?

In the meantime you can try this

replace `user_id` smallint( 6 ) NOT NULL AUTO_INCREMENT ,

by `user_id` 'smallint'( 6 ) NOT NULL AUTO_INCREMENT ,

0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 17

Accepted Solution

by:
psimation earned 1500 total points
ID: 18769720
The problem is almost 100% with the difference in MySQL versions than with php versions.

Try to re-export the db from the server using different options like "Complete Inserts" "Extended Inserts" and "Enclose table and field names with backquotes ". The last time I ran into a similar problem, I just tried different combinations of those options and I eventually got it to work. Better still, just make sure you have the same version of phpmyadmin installed on both servers and the same major number of mysql ( ie. mysql4.x or mysql5.x on both servers)
0
 
LVL 17

Expert Comment

by:psimation
ID: 18769726
Sorry, meant to say PHPMyAdmin AND MySQL versions, ie. PHP version itself should not cause any problems, but the version of phpmyadmin and mysql will play a role; try to get the versions of both to be the same on both servers for maximum compatability.
0
 

Author Comment

by:bbourgeaux
ID: 18778978
I re-exported the database on a different computer this time and it worked! The settings were the same though... strange.
0

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question