MySQL Forums
Forum List  »  Docs

MySQL Connector/J Documentation. Error in readme?
Posted by: donal kelly
Date: August 10, 2004 02:17AM

Hi,

I'm reading the readme from MySQL Connector/J Documentation and it contains the following:

> GRANT ALL PRIVILEGES ON [dbname].* to
> '[user]'@'[hostname]' identified by
> '[password]'
>
> replacing [dbname] with the name of your database, [user]
> with the user name, [hostname] with the host that MySQL
> Connector/J will be connecting from, and [password] with the
> password you want to use.

so I tried the following;
mysql> GRANT ALL PRIVILEGES ON test.* to 'tom@localhost' identified by 'toms_pw';

but this command creates a username "tom@localhost", not "tom" and thus i was getting the following error message when trying to login:
SQLException: Invalid authorization specification, message from server: "Access denied for user: 'tom@localhost' (Using password: YES)"

should the command be: (removing the apostrophe around the username)
mysql> GRANT ALL PRIVILEGES ON test.* to tom@localhost identified by 'toms_pw';
which creates a username "tom".

you can see the difference:
mysql> SELECT Host,User,Password FROM mysql.user;
+-----------+------------------+------------------+
| Host | User | Password |
+-----------+------------------+------------------+
| localhost | root | |
| build | root | |
| localhost | | |
| build | | |
| % | tom@localhost | 3f59413a4bbb0e0f |
| localhost | tom | 3f59413a4bbb0e0f |
+-----------+------------------+------------------+

Am I on the right track here? should the readme command be:
GRANT ALL PRIVILEGES ON [dbname].* to
[user]'@'[hostname] identified by
'[password]'

Options: ReplyQuote


Subject
Views
Written By
Posted
MySQL Connector/J Documentation. Error in readme?
4256
August 10, 2004 02:17AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.