MySQL query syntax

MySQL query syntax

Posted by: silurius
Posted on: 2005-05-31 13:59:00

I am trying to run the following query against my database:

mysql -u [DBUSER] -p [DBNAME] < folder/folder/folder/folder/store.mysql

where the first 'folder' is within the root of my site, and 'store.mysql' is a script residing in the 'store' subdirectory.

Mysql complains with the following, which I can't figure out:

#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 'mysql -u [DBUSER] -p [DBNAME] < folder/folder/folder/folder/store.mysql' at line 1

(I have changed the actual text of the error message to hide the db/folder info).

I know a little SQL but I'm very new to MySQL and it appears the issue is probably related to the path, but I tried deleting folder names and got the same results.

Any help you can provide would be sincerely appreciated!

John

Re: MySQL query syntax

Posted by: decswxaqz
Posted on: 2005-05-31 15:19:00

The password has to be next to the switch ie -pPASSWORD, the user needs a space -u USER.
Unless you are doing a crontab/auto script, you should leave out the password (just use switch) in my opinion. Hope that works?

Re: MySQL query syntax

Posted by: bluequartz
Posted on: 2005-05-31 15:23:00

MYSQL doesnt work at DREAM HOST

never has

never will

Re: MySQL query syntax

Posted by: scjessey
Posted on: 2005-05-31 17:04:00

In reply to:

MYSQL doesnt work at DREAM HOST

never has

never will


What? That simply isn't true. I've had no MySQL problems since moving my accounts here. And with the recent upgrade, we can use subqueries too!

Re: MySQL query syntax

Posted by: silurius
Posted on: 2005-05-31 17:35:00

I was going to challenge that claim as well, but I simply am not having success with this query. I've tried all of the following:

mysql -u [DBUSER] -p[PASSWORD] [DBNAME] < FOLDER/FOLDER/FOLDER/FOLDER/store.mysql
and
mysql -u [DBUSER] -p[PASSWORD] [DBNAME] < web/FOLDER/FOLDER/FOLDER/FOLDER/store.mysql
and
mysql -u [DBUSER] -p [DBNAME] < FOLDER/FOLDER/FOLDER/FOLDER/store.mysql
and
mysql -u [DBUSER] -p [DBNAME] < web/FOLDER/FOLDER/FOLDER/FOLDER/store.mysql

It's just a database dump for several civicspace modules and includes. The error indicates that my my syntax is bad.

Tags: mysql queryquery syntax