Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 :

mysql

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
    
Try: mysql -u root -p and then enter the password in the console. –  user603003 Sep 6 '11 at 6:40
add comment

migrated from stackoverflow.com Sep 7 '11 at 2:15

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

2 Answers

Use:

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
add comment

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.