This is possibly a problem that affects lots of users, I have have found similar posts, but none of the solutions have worked for me.

I have installed mysql on my ubuntu 13.10, however I do not seem to have any rights to do anything. I cannot connect via root, though I do know the root password. I can connect through my user name, though in doing this I get no access rights to create, delete, nor do anything else that is useful.

For example:

mysql> CREATE DATABASE sphider;

ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'sphider'

or if I try to log in using root:

root@rozlockwood-Z87M-D3H:/home/rozlockwood# mysql -u root -p

Enter password:

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

Any help please.

  • Read my answer to this question. root is different from root@localhost – hmayag Apr 16 '14 at 21:05

It should just be a matter of:

sudo apt-get install mysql-server

Follow the prompts to enter a root password during installation.

Then connect:

mysql -u root -p

Enter the password set during installation.

  • thing is, I have already set the mysql-server root password, it was on a blue screen, I know what it is, just mysql doesn't allow me to log in; this is the error message rozlockwood@rozlockwood-Z87M-D3H:~$ mysql -u root -p Enter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) – user2115136 Apr 19 '14 at 12:44
  • I am not using the ubuntu root password; I even reconfigured mysql server, to be sure i had the right password, and still it does not allow root access. – user2115136 Apr 19 '14 at 12:45
  • thanks for you help, i have just got there with an autoremove and a reinstall, i should have tried this first. – user2115136 Apr 19 '14 at 12:49
  • Sorry, I thought this question was dead and didn't log on! But I'm glad you resolved your problem. – Cody Apr 20 '14 at 15:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.