bbourgeaux
asked on
MySQL - phpMyAdmin - syntax error 1064 when trying to import database
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.
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.
ASKER
Thanks for your quick answer but it didn't work. I get the exact same error message.
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 ,
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 ,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
ASKER
I re-exported the database on a different computer this time and it worked! The settings were the same though... strange.
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` )
)