MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old July 20th, 2005, 09:57 AM
cyberbug cyberbug is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 4 cyberbug User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 2 m 10 sec
Reputation Power: 0
mysql error #1064

When I try to backup my database using Direct Admin's database backup option offered by my host I get this error

#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 10

I changed host and now tried to back up the database to my message board.
Info
MySQL version 4.0.23 standard
PHP version 4.3.11 (apache)

Reply With Quote
  #2  
Old July 20th, 2005, 12:18 PM
Madpawn Madpawn is offline
My beat is correct.
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 339 Madpawn User rank is Private First Class (20 - 50 Reputation Level)Madpawn User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 22 h 3 m 33 sec
Reputation Power: 4
I don't think versions older than 4.1 like the CHARSET syntax. If your backup is an .sql file, you should be able to just open it and remove that part.
__________________
"A pawn is the most important piece on the chessboard -- to a pawn"


Reply With Quote
  #3  
Old July 21st, 2005, 07:54 AM
cyberbug cyberbug is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 4 cyberbug User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 2 m 10 sec
Reputation Power: 0
In case I get my host to upgrade to 4.1 or above will it solve the problem without having to remove CHARSET syntax ?

Reply With Quote
  #4  
Old July 21st, 2005, 11:15 AM
Madpawn Madpawn is offline
My beat is correct.
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 339 Madpawn User rank is Private First Class (20 - 50 Reputation Level)Madpawn User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 22 h 3 m 33 sec
Reputation Power: 4
It ought to. And you'd get subqueries.

Reply With Quote
  #5  
Old July 22nd, 2005, 01:24 AM
cyberbug cyberbug is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 4 cyberbug User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 2 m 10 sec
Reputation Power: 0
Quote:
Originally Posted by Madpawn
And you'd get subqueries.


Sorry for sounding too ignorant but what do you mean by that ? Is it a negative or postitve thing ?

Reply With Quote
  #6  
Old July 22nd, 2005, 12:44 PM
Madpawn Madpawn is offline
My beat is correct.
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 339 Madpawn User rank is Private First Class (20 - 50 Reputation Level)Madpawn User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 22 h 3 m 33 sec
Reputation Power: 4
It's very positive. Subqueries were introduced into MySQL with 4.1, and they rock. They can do things that before could only be done with complicated joins or multiple queries.

Reply With Quote
  #7  
Old July 23rd, 2005, 05:53 AM
cyberbug cyberbug is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 4 cyberbug User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 2 m 10 sec
Reputation Power: 0
Quote:
Originally Posted by Madpawn
It's very positive. Subqueries were introduced into MySQL with 4.1, and they rock. They can do things that before could only be done with complicated joins or multiple queries.



Thanks a ton for all your help. :-)

Reply With Quote
  #8  
Old July 24th, 2005, 05:40 AM
gertcuppens's Avatar
gertcuppens gertcuppens is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 118 gertcuppens User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 h 28 m
Reputation Power: 5
Just to give you an example of subqueries.
Locally, I could work with version 4.1 and so the SQL-query in my java class was like this :
Code:
zoekString.append("select * from film ");
zoekString.append(" where filmnummer in ");
zoekString.append("(select filmnummer from filmrol, persoon ");
zoekString.append("where filmrol.persoonsnummer = persoon.persoonsnummer ");
zoekString.append("and (persoon.naam like '%" + _naam + "%' ");
zoekString.append("or persoon.voornaam like '%" + _naam + "%' ) )"); 


Mind the fact that my select statement only contains the table film, since I only want to have the information inside this table. With a subquery
Code:
where filmnummer in 
  (select filmnummer from filmrol, persoon ...)

I take care of the fact that I only want to see films where a certain person has participated.

Unforntunately, on the server the version of MySQL was 4.0. Und the decision of the upgrade was not mine to take.
So, I had to change the SQL query into this :
Code:
zoekString.append("select * from film, filmrol, persoon ");
zoekString.append(" where film.filmnummer = filmrol.filmnummer and ");
zoekString.append("  filmrol.persoonsnummer = persoon.persoonsnummer and ");
(...)
if (_selectie[3] == true && _naam != null)
	{
	zoekString.append(" (naam like '%" + _naam + "%' or "); 
	zoekString.append(" voornaam like '%" + _naam + "%' ) "); 	 
				
	} /* selectie op naam */ 


This works also, but it is less performant.
Now I get the information of 3 tables (film, filmrol, persoon) in my resultset (a java class made to catch information of a database) where I only need the information of only one table. So, this is overhead due to the fact I could not work with subqueries.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > mysql error #1064


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT