TurnKey Linux Virtual Appliance Library

root mysql password on startup

i have problems with mysql password on the turnkey linux images. AMI: turnkey-wordpress-11.2-lucid-x86.ebs (ami-97b077fe) here is the prompt. mysql -u root -p Enter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) i changed passwords on login, as suggested in the following document. http://www.turnkeylinux.org/updates/lamp BTW. these are images 'spun' from the AWS console, not your console. i did not get a prompt and thus root is open with blank password? further, is it the root password set in a database? or the system one. do they match? i also tried the mysqlp4ssw0rd password used in previous versions of your LAMP.
Jeremy's picture

I strongly suggest you use the Hub rather than AWS console

I know nothing about the AWS console and as such can't really comment on how that would all work. When launching from the TKL Hub all passwords (inc MySQL root) are preseeded prior to launch. With a TKL instance running on bare metal or local VM the first boot scripts allow you to set all passwords then, but I don't think it works like that in AWS? As you already have root access to your appliance you may be able to reset the MySQL root password by manually running the script (it works locally - not sure if it will in AWS):

/usr/lib/inithooks/bin/mysqlconf.py

Re Linux root password and access to Webmin: AFAIK if you don't set a Linux root password a random one is set and SSH access is via keypairs -  although I'm not sure if it's like that when using AWS console rather than the Hub (that's what happens if you don't set a root password on launch via the Hub). Assuming that is the case, unless you manually reset the Linux root password, it will not be possible to use Webmin (as it requires the root password to login). The Hub has a commandline/python API so once you have a Hub account you can use that to launch your instance, with passwords etc.

works

it is a mysql issue. and the script worked fine. 

thanks for the note.

Jeremy's picture

Cool

Glad you got it working. I suspect that because of the way you launched it there was no password set, but because it expected one it wouldn't run without one. Only guessing though...

As I said though, I'd highly recommend the Hub. It's too easy really!

Alon Swartz's picture

The Hub handles this stuff...

As Jeremy mentioned, when launching via the Hub, the relevant passwords (root, mysql, application, etc.) will be securely pre-seeded automatically during the instance boot.

But, when launching out of the Hub (via the AWS console / ec2 api), the instance will fall back to randomizing passwords for security. The root and database password will be the same for convenience, and can be pulled out of the instance boot log if required - alternatively you can ssh using the keypair set on launch and manually change the passwords.

The Hub will also setup a security group automatically for you, so don't forget to do it manually if you are going it alone.

Is there any reason you are opting not to use the Hub?

hub, opt in/opt out.

Is there any reason you are opting not to use the Hub?

i came to TKL via the aws instance console, while testing various configurations. i knew not of the hub.

incidentally, your configs are good. it was easy to add mod_pagespeed, which permitted a performance squeeze. dropped from 2.3 s to 1.816 s on an image-dense wordpress site. the page reload was the best ever at .628 s. 

will amazon and TKL accounts synchronize the instances.

Jeremy's picture

TBH I'm not sure...

As I've never used vanilla AWS (only ever used through the Hub) I can't be sure. But one way I'm pretty sure would work is to use TKLBAM to migrate to a new server launched via the Hub. Obviously don't kill your original server until you are 100% sure all is as it should be (to avoid risk of data loss or something else going wrong) but I would imagine that it should be trouble free.

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)