Forum Moderators: open

Message Too Old, No Replies

asking for help on a command

         

sodani

8:12 pm on Sep 17, 2006 (gmt 0)

10+ Year Member



I'm pretty new to MySQL, and this one program is requiring me to run the following command:
mysql -u username -ppassword -h localhost database-name < modules/location/database/zipcodes.mysql

However, am I supposed to run it just the way it is? Or do I have to replace anything? I'm using phpmyadmin, and I'm getting a syntax error when entering as is.

coopster

8:29 pm on Sep 17, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I'm not familiar with phpMyAdmin, but that is a command that should be entered at a command line. Do you have command line access?

sodani

8:59 pm on Sep 17, 2006 (gmt 0)

10+ Year Member



Yes, I do have command line access and I seem to be having difficulty there as well. FYI - from what I understand, you're supposed to be able to use phpmyadmin to execute commands in lieu of a command line.

I tried mysql -u username -ppassword -h localhost database-name < modules/location/database/zipcodes.mysql;

and

mysql -u username -p -h localhost database-name < modules/location/database/zipcodes.mysql;

and they both gave me syntax errors both in phpmyadmin and at the mysql command line...

coopster

12:30 pm on Sep 18, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



The syntax looks correct (well, it did until you added the semicolon to the end there). Are you sure the path is correct to your input file? I use a relative link to designate current working directory when importing from a file in a sub-directory of the current working directory ...
mysql -u username -ppassword -h localhost database-name < ./modules/location/database/zipcodes.mysql

Also, here are some useful links:
mysql — The MySQL Command-Line Tool [dev.mysql.com]
Using mysql in Batch Mode [dev.mysql.com]