Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
While creating a new database iam facing the below problem,i searched in google to solve but i was not able to solve,can any one help me on this.
mysql> create database auto-download-gta;
ERROR 1064 (42000): 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 '-download-gta' at line 1
it's becuase you have dashes in the databse name. Ideally, don't use them, but you can quote the name using backticks apparently. Better to change the name.
Dear all,
While creating a new database iam facing the below problem,i searched in google to solve but i was not able to solve,can any one help me on this.
mysql> create database auto-download-gta;
ERROR 1064 (42000): 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 '-download-gta' at line 1
Must not have looked too hard..putting "linux mysql database name dash" in pulls up 356,000 hits that explain this. The error is very clear, and well-documented. You've got a dash "-" in your database name. Either name your database something else, or put the database name in double-quotes.
If you look any of this up, you'll see LOTS of reasons for not doing this. Mysqldump had (has??) a known issue with databases with dashes in their names. Writing scripts/code for such databases also becomes problematic.
I have given database name with in double-quotes but iam facing the same problem again
mysql> create database "auto-download-gta";
ERROR 1064 (42000): 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 '"auto-download-gta"' at line 1
I have given database name with in double-quotes but iam facing the same problem again
mysql> create database "auto-download-gta";
ERROR 1064 (42000): 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 '"auto-download-gta"' at line 1
Ok...did you read the posts above? Dashes in a DB is *NOT* a good thing. And I'm not at my machine, so I couldn't test the double-quotes, but acid_kewpie posted about backticks. Did you read that and try it?
Once again...dashes in your DB name is not a good idea and will cause problems.
For every search result about putting dashes in database names, there is another about someone using quote marks instead of backticks and complaining that it's still not working.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.