January 7th, 2002, 08:48 PM
same problem -- ERROR 1045: Access denied for user:
I am having the same problem. If you know how to fix it, please email me email@example.com
February 22nd, 2002, 12:56 AM
Re: Access denied for user root???????
I have also same problem, I let you know my findings.Maksure that you /etc/hosts file has
127.0.0.1 localhost.localdomain localhost
192.168.1.1 test.mydomain.com test
secondly try mysql -u root -h 127.0.0.1 -p
or mysql -u root -h test.mydomain.com -p
I hope you will be able to login, like me.
In my user table root has not previliges against Host=localhost.but has previliges against my Host=mydomain. I am going to insert the entries manually and will let you know.
If you have lost the password then run mysql in safe mod
and update the password with localhost.
Re: same problem -- ERROR 1045: Access denied for user:
This is what you do.
shell>mysql -u root -p password
It will prompt you for your root password.
If you have not set root password you can do so by following this.
cd to shell>mysql\bin
type GRANT ALL PRIVILEGES ON *.* TO root@localhost IDENTIFIED BY 'your_password' WITH GRANT OPTIONS;
Then press enter.
GRANT ALL PRIVILEGES ON *.* TO root@"%"localhost IDENTIFIED BY 'your_password' WITH GRANT OPTIONS;
Now you should be able to login in but you must use the first command line example to do so.
September 10th, 2002, 01:48 PM
Re: Access denied for user root???????
OK, here's what you have to do.
1. stop mysql server : this can be done through killall mysqld, and/or killall safe_mysqld if you start it using safe_mysqld
2. restart mysql sever using the --skip-grant-tables, ie /usr/local/bin/safe_mysqld --skip-grant-tables &
(make sure you background it or else you'll have to start a new shell), hit the return key to get back to the prompt
** your server is now wide open, use caution **
3. add a new user using the insert statements :
mysql> INSERT INTO user VALUES('localhost','monty',PASSWORD('some_pass'), 'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
mysql> INSERT INTO user VALUES('%','monty',PASSWORD('some_pass'), 'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
mysql> INSERT INTO user SET Host='localhost',User='admin',
-> Reload_priv='Y', Process_priv='Y';
mysql> INSERT INTO user (Host,User,Password)
mysql> FLUSH PRIVILEGES;
4. stop mysql server : killall mysqld;killall safe_mysqld
5. start mysql and login with your new passwords that you set in the INSERT statements above...
**NOTE if you get "key duplicated errors" you will have to use the UPDATE methods instead of insert... but I just created a new database admin user "dbadmin" and made a new password.
the correct grant command for this new user is : GRANT ALL PRIVILEGES ON *.* TO root@localhost IDENTIFIED BY 'y0uRn3w4dm1np@ss' WITH GRANT OPTION;
September 24th, 2002, 10:00 AM
Bah, crawl back under your rock. Someone took the great effort to explaining grant tables, one of the most powerful and misunderstood parts of MySQL and you want what? A hold-my-hand instant satisfaction personal free one-on-one counseling session?
Lamer, go home.
The first page actually has a link to the basic stuff..
February 28th, 2003, 12:19 AM
How do I stop someone from
looking at tables??
This obvious question is skipped over by all you fine gentleman.
example: I put a password on root,
but I can still start mysqld with NO password and select * from any data table.
So I need to say: Dont start with Blank user
This may be an Install thing.
My point is that the mySQL manual and this fine site do NOT explain this.
The MySQL Grant Tables
The MySQL Grant Tables The MySQL Grant Tables
March 01, 1999 - One of the most powerful aspects of the MySQL server is the amazing amount of control the administrator has over each user's intended behavior. This control can restrict user privileges over a general part of the server, such as limited access to an entire database, but can also be as specific as limiting privileges for a specific table or even column.
Please discuss this article in this thread. You can read the article here .