Fix Mysql5.0 ERROR 1045(forget database password) in Ubuntu Linux
This post was written by admin on October 24, 2009
Posted Under: General
Posted Under: General
I installed Lamp server in my ubuntu jaunty.When I first tried access to mysql database with root,I got an error:
ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: NO)
The password for root by default is null,so we need to reset the password.
Use this command in terminal:
sudo cat /etc/mysql/debian.cnf
We can use the user and password in output to access database,and then reset root password:
# Automatically generated for Debian scripts. DO NOT TOUCH! [client] host = localhost user = debian-sys-maint password = IKORmdRRYQ9JHwtx socket = /var/run/mysqld/mysqld.sock [mysql_upgrade] user = debian-sys-maint password = IKORmdRRYQ9JHwtx socket = /var/run/mysqld/mysqld.sock basedir = /usr
Related posts:
- Enable Remote Access to Mysql database in Ubuntu Linux
- Ask for a password to access recovery mode root console
- How to reset forgotten user/boot password in Ubuntu
- How to Login Without Password in Ubuntu 11.10
- Reset the forgotten password in Ubuntu
Tags: server
