467,184 Members | 1,258 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,184 developers. It's quick & easy.

ERROR 1045: Access denied

Hi programmers, Good morning ;-)

I think something is wrong,
Running windows I believe first I have to set some password,
Which creates some user,
Then I can grant the required privileges, for some databases.

However granting privileges after setting password seems to reset some
Other access,
===
C:\temp\Menagerie_01>mysql -u root -p****** mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 4.1.0-alpha-max-debug

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> set password for 'elmasri'@'localhost'=password('navathe');
Query OK, 0 rows affected (0.02 sec)

mysql> set password for 'elmasri'@'%'=password('navathe');
Query OK, 0 rows affected (0.00 sec)

mysql> grant all on company.* to 'elmasri'@'localhost' identified by
'navathe';
Query OK, 0 rows affected (0.02 sec)

mysql> grant all on company.* to 'elmasri'@'%' identified by 'navathe';
Query OK, 0 rows affected (0.00 sec)

mysql> quit
Bye

C:\temp\Menagerie_01>mysql -u elmasri -pnavathe company
ERROR 1045: Access denied for user: 'e******@127.0.0.1' (Using password:
YES)

===
However if I use only the grant statement,
I don't need any set password statement,

Both setting password and granting all privileges
-> ERROR 1045: Access denied

But Why ?

===
C:\temp\Menagerie_01>mysql -u root -p***** mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 12 to server version: 4.1.0-alpha-max-debug

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> grant all privileges on company.* to 'monty'@'localhost'
identified by
'python' with grant option;
Query OK, 0 rows affected (0.00 sec)

mysql> quit
Bye

C:\temp\Menagerie_01>mysql -u monty -ppython company
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 13 to server version: 4.1.0-alpha-max-debug

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show tables
-> ;
+-------------------+
| Tables_in_company |
+-------------------+
| blabla |
+-------------------+
1 row in set (0.01 sec)

mysql> drop table blabla;
Query OK, 0 rows affected (0.00 sec)

mysql> show tables;
Empty set (0.00 sec)

mysql> create table blabla ( fname varchar(15) not null )type=innodb;
Query OK, 0 rows affected (0.00 sec)

mysql> show tables;
+-------------------+
| Tables_in_company |
+-------------------+
| blabla |
+-------------------+
1 row in set (0.00 sec)

mysql>
====

Yours Sincerely

Morten Gulbrandsen
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/my***********...ie.nctu.edu.tw

Jul 19 '05 #1
  • viewed: 4166
Share:

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Morten Gulbrandsen | last post: by
reply views Thread by Morten Gulbrandsen | last post: by
3 posts views Thread by dstewart@pcfa.org | last post: by
2 posts views Thread by arsisthesis | last post: by
3 posts views Thread by Greg Noss | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.