Everything MySQL

A great place to be!

i am a complete newbie to mysql and linux.what happened is i installed mysql and did this:
SET PASSWORD FOR 'arun'@'localhost' = PASSWORD('pass');
GRANT ALL PRIVILEGES ON *.* TO 'arun'@'localhost' IDENTIFIED BY 'pass' WITH GRANT OPTION;

then i ended up deleting the user with:
mysql>delete from mysql.user where not (host="localhost" and user="root");
and logged out of mysql

the problem is now i cant login and i get this error:

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

i guess now there are no users and password.please help me login.my exams are very close

Views: 209

Reply to This

Replies to This Discussion

Hi Arun,

How are you trying to log in? Are you using mysql -uarun -ppass ?
before when my user exist i used:
mysql -p -u arun
then it asks password:pass
sql opens...
now this is not working as i have deleted my user....what do i do??????????
If you indeed deleted your user account, then see Chris's post: http://everythingmysql.ning.com/profiles/blogs/no-password-no-problem
or this page in the reference manual: http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html
everythings kinda going over my head...lol
where do i type this:
--skip-grant-tables
it says -bash: --skip-grant-tables: command not found
pls tell a bit in detail..
When you start mysql do this:

Starting mysql example:
mysqld_safe --defaults-file=/etc/my.cnf --skip-grant-tables --user=mysql &

Where /etc/my.cnf is the full path to your configuration file...

You can also add skip-grant-tables to your my.cnf file under the [mysqld] section

example:

[mysqld]
skip-grant-tables

RSS

RSS

© 2024   Created by Chris.   Powered by

Badges  |  Report an Issue  |  Terms of Service