Tuesday, 10 June 2014

GRANT ALL ON *.* TO 'vagrant'@'localhost' fails with ERROR 1045 (28000): Access denied for user 'root'@'localhost'

We use Vagrant for our development environment.

In the Vagrant provisioning script we have creation of mysql user "vagrant" who can do anything:
/usr/bin/mysql -u root -e "GRANT ALL ON *.* TO 'vagrant'@'localhost';"
One day we upgraded mysql from 5.1 to 5.5 and this command started to throw an error:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

We were struggling with it for a while - comparing my.cnf file and other configuration, checking rights on socket, tables etc. Finally the solution was easy, we just forgot to start mysql upgrade command :)

Solution was:
mysql_upgrade -u root
After this everything works as expected for us.

Note: See that in the mysql command we don't use -p parameter, that's because we have user root also without password.
Note2: There are probably many situations where error "Access denied for user 'root'@'localhost'" can happen, this blogpost is just description of one situation with solution.

Thursday, 5 June 2014

Skype opens links in Firefox instead of default browser (Google Chrome) - Fedora 20 LXDE

I found this solution on the web:
 sudo update-alternatives --config x-www-browser  
And then select wanted browser. But it didn't work for me - it did nothig, no output, nothing to select. (I guessed I had no x-www-browser group)

So I created the "x-www-browser" group in alternatives and set google chrome as my default browser by this command:
 sudo update-alternatives --install /usr/bin/x-www-browser x-www-browser /usr/bin/google-chrome 20  

Now when I write
 sudo update-alternatives --list  
I can see that x-www-browser was added.

Also new link was created in "/usr/bin/":
 $ ll /usr/bin/x-www*  
 lrwxrwxrwx. 1 root root 31 Jun 4 10:30 /usr/bin/x-www-browser -> /etc/alternatives/x-www-browser  

And now when I click in skype on a link... it's opened in Chrome ;)