fekaduw Posted July 2, 2007 Share Posted July 2, 2007 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 https://forums.phpfreaks.com/topic/58132-phpmyadmin-error/ Share on other sites More sharing options...
AndyB Posted July 2, 2007 Share Posted July 2, 2007 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 https://forums.phpfreaks.com/topic/58132-phpmyadmin-error/#findComment-288307 Share on other sites More sharing options...
fekaduw Posted July 2, 2007 Author Share Posted July 2, 2007 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 https://forums.phpfreaks.com/topic/58132-phpmyadmin-error/#findComment-288328 Share on other sites More sharing options...
AndyB Posted July 2, 2007 Share Posted July 2, 2007 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 https://forums.phpfreaks.com/topic/58132-phpmyadmin-error/#findComment-288329 Share on other sites More sharing options...
fekaduw Posted July 2, 2007 Author Share Posted July 2, 2007 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 https://forums.phpfreaks.com/topic/58132-phpmyadmin-error/#findComment-288339 Share on other sites More sharing options...
fekaduw Posted July 2, 2007 Author Share Posted July 2, 2007 i have no progress. I need ur helpy guys! Link to comment https://forums.phpfreaks.com/topic/58132-phpmyadmin-error/#findComment-288347 Share on other sites More sharing options...
corbin Posted July 2, 2007 Share Posted July 2, 2007 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 https://forums.phpfreaks.com/topic/58132-phpmyadmin-error/#findComment-288353 Share on other sites More sharing options...
fekaduw Posted July 7, 2007 Author Share Posted July 7, 2007 i tried it on version 4 Link to comment https://forums.phpfreaks.com/topic/58132-phpmyadmin-error/#findComment-292096 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.