permaculture playing cards
The moose likes JDBC and Relational Databases and the fly likes MySQL user and password errors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "MySQL user and password errors " Watch "MySQL user and password errors " New topic

MySQL user and password errors

Cathy Valdez

Joined: Oct 22, 2003
Posts: 23
MySQL 4.0.17 and MySQL Connector/J 3.0 were installed in my PC.
1.) I'm trying to create a user at the same time grant privileges to that user using MySql, by this command:

For example:

but error below occurred:

2.) I'm trying to connect to the server, by the command below:

but error below occured:

Can anybody there help? I'm new to MySQL, what do errors above mean? What should I do to fix those errors?
Any suggestions would be greatly appreciated. Thanks in advance.
[ February 13, 2004: Message edited by: Cathy Valdez ]
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
Does the DB actually require a user/password and have you tried Aaccesing it without one? I have myAQL running on my local machine and I never have to access it without a user/password.
I connect to a DB called "notepad" as follows.
Connection databaseConnection = DriverManager.getConnection("jdbc:mysql://localhost/notepad");

So much trouble in the world -- Bob Marley
leo donahue
Ranch Hand

Joined: Apr 17, 2003
Posts: 327
Hi Cathy,
I think that using the -h switch allows you to connect to a MySQL database if it were installed on another machine. Maybe you could just try using:
c:mysql\bin>mysql -u cathy -p
Try logging in as root and then run this sql statement:
grant create, create temporary tables, delete, execute, index, insert,
lock tables, select, show databases, update
on WordGames.*
to cathy@localhost identified by 'aprfeb';

Thanks, leo
I agree. Here's the link:
subject: MySQL user and password errors
It's not a secret anymore!