Before you start trying to redirect contents to MySQL you'd better check
that you can access MySQL using your user name and password on the
host you intend to script on and don't forget to provide the database. I
find using the longer command line options more useful when debugging.

Such as:

#> mysql --database=db --user=username --host=localhost --password

And don't forget that MySQL has built in help.

#> mysql --help

Carter.

On Mar 15, 2006, at 7:56 AM, Jerry Kassebaum wrote:

I'm still not able to run a batch file from mysql. Here are my latest attempts:

C:\Prog\Perl\MySql\mysqlDocs>mysql -u root < go.txt
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

C:\Prog\Perl\MySql\mysqlDocs>mysql -u localhost -p < go.txt
Enter password: *******
ERROR 1045 (28000): Access denied for user 'localhost'@'localhost' (using password: YES)

Here is the contents of go.txt: select * from pet;

****************************


Jerry Kassebaum wrote:
I'm trying to learn mySql for use with cgi, so I hope y'all will consider this close enough to a perl question.

I have a file called perl.dbt that contains a batch file to a database. (It should list all the books I've read with Perl in the title.)

When I go to the command prompt and enter

mysql < c:\perl\mysql\perl.dbt

I get an error:

ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO)

Now what?

Supply a valid user name on the command line, like this:

mysql -u username -p < perl.dbt

This will prompt you for the password (the password must not be contained in perl.dbt). To supply the password on the command line, write

mysql -u username -ppassword < perl.dbt

Note there is a space between -u and the username but none between - p and the password.

Hans


_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to