Home » Forums » DBManager General
 
SQL syntax ERROR (1771 previews)
SQL syntax ERROR Posted in 03th, 08/2005 01:46 by laideez_xtacee
When I try to load a dump file (which i have tested localy & works) to the blank database on the remote server I get the following error which is below.

------------------------
MySQL ERROR
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 19
Query:
Create Table ' ..... etc etc

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


Discounts and Coupons
Re: SQL syntax ERROR Posted in 03th, 08/2005 09:49 by support
Hi,

Could you send more information about the DBManager and mysql version you are using?
If possible it would be nice to attach the dump to support@dbtools.com.br.

Thanks,

Support / DBTools Software
Re: SQL syntax ERROR Posted in 03th, 08/2005 11:12 by laideez_xtacee
i had to take out all the latin references and it worked. I think the problem is the remote server is using an older version of MySql

On another note I find that DB tools sort of crashes while loading large dump files but it will work in the background & then come back to normal when completed which can take some time. Im not sure if the speed is based on Server performance, local PC performance or Internet connection? I think a status bar would be nice instead of this so we can see how much longer it will take.



rAd /
Re: SQL syntax ERROR Posted in 03th, 08/2005 11:27 by support
Hi,

Actually when dealing with different server versions a lot of extra care need to be taken. It would be a good idea to always check the dumped structure to know if it will fit the server destination, specially if it is a remote server. Also it would be good to split the dump into two files, one for structure and another for data. Data is always the same no matter what version you are using. This makes the process of checking the dumped structure a lot easier.

If you can please send us a copy opf the dumped file that is crashing DBManager. This will help us a lot to fix the problem.
A progress bar it is not applicable in here. The reason is that is very difficult to know how many statements are in the dumped file. We can, on the other hand, implement a Line Feed count and step the progress control for each LF read from the file.

Best Regards,

Support / DBTools Software
Re: SQL syntax ERROR Posted in 03th, 08/2005 11:50 by laideez_xtacee
Hi,

Here is the part that caused me the problem ( i have taken out all records except the first:

My solution was to do a search & replace on " collate latin1_bin" & on " DEFAULT CHARSET=latin1"

How would I check the file to be compatible like you suggested before hand to see if it will work with the server?


# DBTools DBMYSQL - MySQL Database Dump
#

SET FOREIGN_KEY_CHECKS=0;

# Dumping Table Structure for phpbb_auths

#
CREATE TABLE `phpbb_auths` (
`group_id` mediumint(8) NOT NULL default '0',
`obj_type` char(1) character set latin1 collate latin1_bin NOT NULL default '',
`obj_id` mediumint(8) NOT NULL default '0',
`auth_name` varchar(50) NOT NULL default '',
`auth_value` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`group_id`,`obj_type`,`obj_id`,`auth_name`),
KEY `group_id` (`group_id`,`obj_type`),
KEY `obj_type` (`obj_type`,`obj_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
#
# Dumping Data for phpbb_auths
#
INSERT INTO `phpbb_auths` (group_id, obj_type, obj_id, auth_name, auth_value) VALUES (10003, 'g', -3, 'ucp_edit_profile', 1);

SET FOREIGN_KEY_CHECKS=1


rAd /
Re: SQL syntax ERROR Posted in 03th, 08/2005 01:25 by support
Hi,

I see the point. Usually the table dump is performed directly by the database server by issuing a show create table. This includes all the features available for that particular mysql version. In this case your remote server probably does not support the character set, collation and ENGINE (which used to be TYPE in older versions).

In order to prevent this problem you may have to use the same server version. By doing that the dumps will definitelly be compatible in your local and remote servers.

We could fix this, but it would require a lot of extra work to create the statement, which MySQL gives at no cost. I will take note of this issue and work on that to improve a bit.

Thanks for the feedback.

Best Regards,

Support / DBTools Software
Re: SQL syntax ERROR Posted in 12th, 08/2005 08:18 by laideez_xtacee
Hi,

I was meaning to reply to let you know I appreciate the prompt support. I've been using DBTools quite a bit since and it has been a great program,

thanks rAd
rAd /
Re: SQL syntax ERROR Posted in 24th, 08/2005 03:56 by laideez_xtacee
Hi,

Im working on another database, trying to create it and I'm having the same issue again but it's a bit different.


Here is my query (I have replaced irelevent data with (....rest of query here...):

SET FOREIGN_KEY_CHECKS=0;

# Dumping Table Structure for pld_category

#
CREATE TABLE `pld_category` (
(....rest of query here...)
`STATUS` INT(11) NOT NULL DEFAULT '1',
`DATE_ADDED` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`HITS` INT(11) NOT NULL DEFAULT '0',
(....rest of query here...)
) ENGINE=MyISAM DEFAULT;
#

and here is my error

Executing Query. Wait ...
MySQL ERROR:

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 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`HITS` INT(11)

QUERY:

CREATE TABLE `pld_category` (
`ID` INT(11) NOT NULL auto_increment,
(....rest of query here...)
`DATE_ADDED` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`HITS` INT(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`ID`),
(....rest of query here...)
) ENGINE=MyISAM DEFAULT


I would like to know if I can replace the bit that causes the error with something else? and how would I do that?



rAd /
Re: SQL syntax ERROR Posted in 24th, 08/2005 09:15 by support
Hi,

Are you sure the mysql version you are using supports the CURRENT_TIMESTAMP?

Which mysql server version is this one?


Support / DBTools Software
Re: SQL syntax ERROR Posted in 24th, 08/2005 09:45 by laideez_xtacee
hi,

my own local server specs which is were I created the database & dump file is below:

MySQL version : 4.1.8

My remote server where I'm trying to do the Query with the dump is below:

MySQL 4.0.21


rAd /
RE: SQL syntax ERROR Posted in 25th, 03/2015 04:32 by linmikey
You get the sense that Pele knows iphone 6 plus protective film what you are going to ask him even before you start to formulate the words. Double Sided Adhesive Perhaps it is just natural intuition, the same instinctive understanding for human behaviour—and how he can use that to his own advantage—that die cut helped make him the greatest footballer, and the most prolific goalscorer, Stand Up Pouches the sport has ever seen.

zenok5528 /

SQL syntax ERROR (1771 previews)
Legends

Topic has Replies
Topic With no Replies
 
Home » Forums » DBManager General