TurnKey Linux Virtual Appliance Library

MySQL access problem (EC2 AMI instance)

kimmo.karhu's picture


I have launched the EC2 AMI (lamp) instance using the instructions:


I am able to make a shell connection to my instance and login as a root.

However, I am not able to connect to the mysql from the shell. If I run "mysql" I get the following error message:

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

Is there some default password set for mysql root during the launching / installation process?

Is there any "getting started document" available for EC2 AMI lamp instance?

Thanks in advance for your help.


Alon Swartz's picture

Initial passwords are available in /root/README

Firstly, thanks for pointing this out. I have just updated the documentation to include the following note:

The initial root password (as well as the MySQL:root and PostgreSQL:postgres where applicable) are set randomly on firstboot for security reasons, and is available in /root/README.

BTW, we are working on a new mechanism which will make the process of launching and managing cloud instances a lot easier, as well as providing an option to configure passwords.
Jeremy Davis's picture

TBH I haven't done that

But I would've assumed that even when you "Launch a New Server from the Hub Backup Set" that you would still set the passwords from the Hub UI (although obviously I'm not sure).

When you say 'connect to MySQL' I assume you mean phpMyAdmin (seeing as you mention port 12322 above). If your old MySQL root password doesn't work and you didn't set one at launch then there is a way to reset it (as long as you have system root CLI access). I don't recall exactly what it is OTTOMH but if you have a google you should be able to find instructions. Still this is obviously not how it should be...

When I get a chance I'll have a look.

Jeremy Davis's picture

IIRC I answered this question somewhere else?

But just in case I didn't (and/or someone else finds this thread looking for answers) I will post here.

You can log into phpMyAdmin with any valid MySQL user account (using the password of that account) - but you will only have the level of access that the MySQL user has. Because of that I personally like to use the MySQL root account (note this is not the Linux root user; which is used to log in to Webshell, SSH/SFTP and Webmin). If you need to reset the MySQL root account, you can do that with the firstboot script, which can be manually run with:


Jeremy Davis's picture


Thanks for your kind words. And yes sometimes it is good to have multiple answers about the place.

As for putting stuff in the docs they are a wiki so feel free to copy paste stuff there or even just post links. I know it's not quite as quick and easy, but it's not too bad.

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)