error in SQL syntax

This is a discussion on "error in SQL syntax" within the Databases section. This forum, and the thread "error in SQL syntax are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > Databases

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Jan 27th, 2006, 16:49
Junior Member
Join Date: Jan 2006
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation error in SQL syntax

Hello everyone

I am trying to make a database in
MySqlManager.

But it just says this:

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 ''TEST_DB'' at line 1

What does this mean?
Is the Query ok?

Please Help

Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Jan 28th, 2006, 08:21
Junior Member
Join Date: Jan 2006
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Re: error in SQL syntax

Have any of you got any ideas?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Jan 28th, 2006, 10:24
Junior Member
Join Date: Dec 2005
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Re: error in SQL syntax

Just a guess here, but I think it means you have an error in your syntax.
How would we know?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Jan 28th, 2006, 13:01
Junior Member
Join Date: Jan 2006
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Re: error in SQL syntax

Quote:
Originally Posted by SweetLou
Just a guess here, but I think it means you have an error in your syntax.
How would we know?
What is syntax?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Jan 28th, 2006, 14:03
Junior Member
Join Date: Dec 2005
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Re: error in SQL syntax

What you wrote and how you wrote it. Something like:
Code: Select all
SELECT field FROM table WHERE id=2;
We would need to see you code to see what you did wrong.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Jan 28th, 2006, 15:08
Junior Member
Join Date: Jan 2006
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Re: error in SQL syntax

Quote:
Originally Posted by SweetLou
What you wrote and how you wrote it. Something like:
Code: Select all
SELECT field FROM table WHERE id=2;
We would need to see you code to see what you did wrong.
The sql Query i uesed was:

CREATE DATABASE 'TEST_DB'
i used phpmyadmin

Last edited by Drgreenfingers; Feb 1st, 2006 at 19:03.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Jan 28th, 2006, 20:05
Reputable Member
Join Date: Sep 2005
Location: Canada, BC
Age: 24
Posts: 239
Thanks: 0
Thanked 0 Times in 0 Posts
Re: error in SQL syntax

Your error is a simple one you used ' instead of `
Code: Select all
CREATE DATABASE `TEST_DB`
This is the correct form you used quotes for data, tilds (`) for database/table/column names
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Jan 29th, 2006, 12:01
Junior Member
Join Date: Jan 2006
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Re: error in SQL syntax

Quote:
Originally Posted by Pheonix
Your error is a simple one you used ' instead of `
Code: Select all
CREATE DATABASE `TEST_DB`
This is the correct form you used quotes for data, tilds (`) for database/table/column names
I tryed this but this is what i got:

1044 - Access denied for user ''@'localhost' to database 'test_db'

Last edited by Drgreenfingers; Feb 1st, 2006 at 19:02.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Jan 29th, 2006, 14:04
Junior Member
Join Date: Jan 2006
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Re: error in SQL syntax

drgreenfingers, see the personal note I sent to you via posting in the forums.

As to your question, do you have proper permissions to create database with that user? Did you set up mysql on your own machine? If so did you set up proper user permissions?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old Jan 29th, 2006, 15:59
Junior Member
Join Date: Jan 2006
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Re: error in SQL syntax

Quote:
Originally Posted by guelphdad
drgreenfingers, see the personal note I sent to you via posting in the forums.

As to your question, do you have proper permissions to create database with that user? Did you set up mysql on your own machine? If so did you set up proper user permissions?
no i haven't
so how do you set up permissions?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #11  
Old Jan 30th, 2006, 02:00
Junior Member
Join Date: Jan 2006
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Re: error in SQL syntax

Look in the mysql manual on using GRANT permissions to set up a user. If the user does not have permissions to create tables or databases you won't be able to do anything with that user.

Is this on your own machine or a hosted machine? If on your own machine are you connecting as ROOT to mysql or are you connecting as a regular user?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
error, sql, syntax

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] error in SQL syntax but where it all looks fine to me Andrew1986 Databases 3 Nov 28th, 2007 01:21
Syntax error with Ajax file reading Paramiliar JavaScript Forum 0 Aug 12th, 2007 16:48
syntax error... ktsirig Databases 2 Feb 4th, 2007 14:48
Annoying little syntax error adeking Web Page Design 4 Aug 9th, 2006 13:50
syntax error: unexpected T_BOOLEAN_AND... jswebdev PHP Forum 4 Jan 28th, 2006 07:29


All times are GMT. The time now is 12:19.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42