In order to work on Ruby 1.9.3/Rails 3.2.2 application, I have installed MySQL 5.1 in my Ubuntu machine using (this script). But after that, I'm unable to login to console or doing any operation.

How can I get username and password or list databases and querying?


How can I get username and password?

The default user is root, no password.

If you have never assigned a root password for MySQL, the server does not require a password at all for connecting as root. However, this is insecure. For instructions on assigning a password, see Section 2.10.4, “Securing the Initial MySQL Accounts”.

Source How to Reset the Root Password


Upon checking the script that you are using, the code belows in the script that says

mysqld_safe -user=mysql &

should start mysqld server as the user(mysql) "AND" should execute the mysql_secure_installation script which will help you step through the following:

  • Reset mysql root password
  • Remove anonymous user
  • Disable remote access to mysql
  • Reload privilege tables.
  • etc . .

And as what DavidPostill said above there is no default root password, so when it ask you to enter the default root password just hit "Enter".

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.