Jump to content

phpmyadmin error!


fekaduw

Recommended Posts

hello there,

 

whenever i try to import an sql file that contains all my tables to mySql db providing appropriate host name, user name and password using phpmyadmin, it displays an error message that reads:

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 'DEFAULT CHARSET=latin1' at line 23

 

the sql in the file reads as:

CREATE TABLE `tblaboutus` (

`title` varchar( 64 ) NOT NULL default '',
`description` text NOT NULL ,
`picture` varchar( 64 ) NOT NULL default ''
) ENGINE = MYISAM DEFAULT CHARSET = latin1 

 

what could be the problem and what should i do. i really need ur help!

 

thanks a lot

Link to comment
Share on other sites

Probably you need to change ENGINE to TYPE in each table. Simple text editor can do that for you on your db dump.

 

To confirm the type and collation, create a new table from scratch with phpMyAdmin then export it and view it to get the right syntax for your version.

Link to comment
Share on other sites

I just changed ENGINE by TYPE but still it displays the error;

 

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 'DEFAULT CHARSET=latin1' at line 23 what other options do i have?

Link to comment
Share on other sites

thank you. i just did what u said. i created a table and looked into its version: its something like

 

-- phpMyAdmin SQL Dump

-- version 2.6.1-pl3

-- http://www.phpmyadmin.net

--

-- Host: localhost

-- Generation Time: Jul 03, 2007 at 12:06 AM

-- Server version: 4.1.10

-- PHP Version: 5.0.4

--

-- Database: `testdb`

--

 

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

 

--

-- Table structure for table `fekadu`

--

 

CREATE TABLE `fekadu` (

  `id` int(11) NOT NULL auto_increment,

  `name` varchar(64) NOT NULL default '',

  PRIMARY KEY  (`id`)

) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

 

--

-- Dumping data for table `fekadu`

--

 

therefore, i changed all the MYISAM DEFAULT CHARSET = latin1 by ENGINE=InnoDB DEFAULT CHARSET=latin1 but still the same error is being displayed.

 

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 'DEFAULT CHARSET=latin1' at line 23

 

what could be the problem then?

Link to comment
Share on other sites

Your SQL query has been executed successfully (Query took 0.0449 sec)

SQL query:

CREATE TABLE `tblaboutus` (

`title` varchar( 64 ) NOT NULL default '',

`description` text NOT NULL ,

`picture` varchar( 64 ) NOT NULL default ''

) ENGINE = MYISAM DEFAULT CHARSET = latin1

 

Worked fine for me.... What version of MySQL are you running?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.