0

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.

1
  • Try: mysql -u root -p and then enter the password in the console.
    – user603003
    Sep 6, 2011 at 6:40

2 Answers 2

2

Use:

mysql -u root -p

and enter password when required.

3
  • @Mauro: did you solve your problem?
    – Marco
    Sep 6, 2011 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, 2011 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, 2011 at 7:07
0

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.

You must log in to answer this question.