Sunday, June 08, 2014

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

When i had been working with nginx, i got the issue "ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)" when i execute the following command:
$ mysql -u root 
Error 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
To Fix the issue, i performed the bellow command:
1. Stop mysqld deamons.
$ sudo service mysql stop
2. Go to mysql/bin directory
$ cd /usr/bin
3. Start mysql deamons with option.
$ sudo mysqld_safe --skip-grant-tables
4. Open another terminal and open a mysql session to execute this:
$ mysql
mysql> use mysql;
mysql> UPDATE user SET password=PASSWORD('YOUR_NEW_PASSWORD_HERE') WHERE user = 'root';
mysql> exit;
5. Now kill the mysqld_safe process and restart mysqld normally:  
$ sudo service mysql start
That's it. Now you can access the mysql console :)



Saturday, June 07, 2014

Fix: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

I have already apache web server installed. Then i am going to install nginx. After installation i gonna start nginx server but failed! and shows mw the following message:

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

The issue is arise due to apache web server. Because i already run this within port 80. So the issue is fixed when i stop apache web server process and then start  again nginx web server. I followed the bellow command in terminal:

sudo service apache2 stop

sudo service nginx start

The above fixed my issue!