FutureQuest, Inc. FutureQuest, Inc. FutureQuest, Inc.

FutureQuest, Inc.
Go Back   FutureQuest Community > General Site Owner Support (All may read/respond) > PHP, Perl, Python and/or MySQL
User Name
Password  Lost PW

 
Thread Tools Display Modes
Old 08-26-2003, 10:49 PM   Postid: 94517
rsimmons
Visitor

Forum Notability:
0 pts:
[Post Feedback]
 
Join Date: Aug 2003
Posts: 8
MySQL batch mode problems

I'm trying to create some tables in a database using batch mode. I'm getting the following error when I try to execute the sql:

ERROR 1044 at line 10: Access denied for user: 'xalrubinstudio@scooter.futurequest.net' to database 'xalrubinstudio_2

Line 10 is the first non-comment line in the sql file. It reads:
USE xalrubinstudio_2

I'm typing the following command at the shell prompt:
mysql -u xalrubinstudio -p -h 69.5.6.126 < structure.sql

To clear up a few obvious things:
1) I can and have logged into MySQL using my password.
2) xalrubinstudio_2 does exist.
3) I'm using the following comment symbol: --

I've used batch mode before, and I just can't figure out what I'm doing wrong here. Any ideas?

Thanks,
Raymond
rsimmons is offline  
Old 08-27-2003, 05:36 AM   Postid: 94522
 Terra
CTO FutureQuest, Inc.
 
Terra's Avatar
 
Join Date: Jun 1998
Location: Z'ha'dum
Posts: 7,518
Quote:
Line 10 is the first non-comment line in the sql file. It reads:
USE xalrubinstudio_2

Try changing that to:
USE xalrubinstudio_2;

of note, the missing semicolon...

You will most likely want to specify one of your databases, so that MySQL can fully validate your credentials:
mysql -u xalrubinstudio -p -h 69.5.6.126 xalrubinstudio_2 < structure.sql

even this will work:
mysql -u xalrubinstudio -p -h 69.5.6.126 xalrubinstudio < structure.sql

since you are changing databases within the batch script...

I would also _highly_ recommend you use the proper MySQL hostname provided to you in your MySQL Activation Letter *instead* of using the IP address of: 69.5.6.126

FutureQuest does retain the right to shift your databases to another backside MySQL engine without notice, and using the provided MySQL hostname is what offers us the flexibility to do so transparently...

--
Terra
--all it takes is one character to ruin a perfectly good script--
FutureQuest

Last edited by Terra : 08-27-2003 at 06:10 AM.
Terra is offline  
Old 08-27-2003, 06:33 AM   Postid: 94523
 Terra
CTO FutureQuest, Inc.
 
Terra's Avatar
 
Join Date: Jun 1998
Location: Z'ha'dum
Posts: 7,518
And finally...

I took a peek at the file, and it is clear that you did not upload that file in ASCII mode... It is full of "CRLF" or "\r\n" line endings...

You can fix this in one of three ways (there are many more):
1) Go into your CNC FileManager and use the CRLF strip feature
2) Dowload the file, via FTP, and reupload it in ASCII mode (not Binary mode)
3) At the CLI by doing: perl -pi -e 's#\r\n$#\n#' structure.sql

the mysql command will correctly import dump files with CRLF and it will also allow USE statement to be used without a trailing semicolon, however when it tried to parse the following line:
USE xalrubinstudio_2

without the semicolon, it saw the database name as:
xalrubinstudio_2\r

What I first noticed was your error message that you pasted in, which was missing the ending single quote
-- database 'xalrubinstudio_2

This led me to start backtracking, and sure enough my hypothesis was correct, your import file was full of \r\n terminators...

In short, it was a combination of fire and gasoline... Separate, there should have been no problem, but when you combine them - KaBoom!

--
Terra
--pyrotechnics 101--
FutureQuest
Terra is offline  
Old 08-27-2003, 10:15 AM   Postid: 94555
rsimmons
Visitor

Forum Notability:
0 pts:
[Post Feedback]
 
Join Date: Aug 2003
Posts: 8
Thanks!

I continue to be amazed by the willingness of the FQ staff to go the extra mile in helping clients resolve technical issues. Thanks so much!

I haven't had a chance to upload the file in ASCII format, but I'm 100% certain that will resolve it. Your response makes complete sense. And I know exactly how that file ended up in binary format and I'm frustrated that I let that slip past me

Kind regards,
Raymond Simmons
rsimmons is offline  


Currently Active Users Viewing This Thread: 1 (0 members and 1 visitors)
 
Thread Tools
Display Modes

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
Forum Jump


All times are GMT -4. The time now is 03:13 AM.


Running on vBulletin®
Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.
Hosted & Administrated by FutureQuest, Inc.
Images & content copyright © 1998-2010 FutureQuest, Inc.
FutureQuest, Inc.