MySql Error in ubuntu
March 2nd, 2009was trying to install mysql in ubuntu using apt-get install mysql-server
Encounter the following error:
Access denied for user ‘root’@'localhost’ (using password: YES)
had a hard time trying to find out the problem and trying to solve it. this blog save the day
http://blog.dotkam.com/2007/04/10/mysql-reset-lost-root-password/
extract of what i did/the blog did:
Here is how to stop/kill the existing mysql daemon, in case it is running:
Step 1: Checking and killing process
ps -ef | grep mysql - checks if mysql/mysqld is one of the running processes. kill xxxx - kills the daemon, if it is running. xxxx-number of the process
Step 2: Run MySQL safe daemon with skipping grant tables
mysqld_safe –skip-grant-tables &
Step 3: Login to MySQL as root with no password
mysql -u root mysql
Step 4: Run UPDATE query to reset the root password
In MySQL command line prompt issue the following two commands:
UPDATE user SET password=PASSWORD("password") WHERE user="root"; FLUSH PRIVILEGES;
password is the password for the root user
Step 5: Stop MySQL safe daemon
Follow the first two steps
Step 6: Start MySQL daemon/etc/init.d/mysql start
etc.. check existing MySQL configuration
Step 7: Root password is reset and ready to use
Password is reset. Privileges are flushed. Start MySQL and login as root with the password set in step 4:
mysql -u root -p mysql
so in all, i think my password was wrong. well, going to my next task
