Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've just installed Mysql on Ubuntu 10.4 LTS and unfortunately I've been experiencing serious problems.

Using the terminal I gain root access (through the commands:sudo su) and I type :


immediately I get this error:

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

Then I type:

mysqladmin -u root fist_p second_p_151

and I get:

mysqladmin: connect to server at 'localhost' failed

error: 'Access denied for user 'root'@'localhost' (using password: NO)'

I also get errors whenever I want to import a sql file.

share|improve this question

migrated from Sep 7 '11 at 2:15

This question came from our site for professional and enthusiast programmers.

Try: mysql -u root -p and then enter the password in the console. – user603003 Sep 6 '11 at 6:40


mysql -u root -p

and enter password when required.

share|improve this answer
@Mauro: did you solve your problem? – Marco Sep 6 '11 at 6:56
Yes I did thanks a lot ..I still have a few more questions..I do have problems importing a sql file – Mauro Sep 6 '11 at 7:04
@Mauro: accept the answer and ask another question to SO. Take a look to other question: I'm sure you can find the answer there... – Marco Sep 6 '11 at 7:07

MySQL Server has its own users, passwords and permissions. You simply can't log into MySQL using your regular Linux users, even if they have the same name (such as root). Thus doing sudo su serves no purpose.

Have a look at the -u and -p parameters in the manual.

share|improve this answer

You must log in to answer this question.