[TriLUG] mysql root pw with non-interactive lamp server install?

Tom Barron tpb at dyncloud.net
Wed Nov 4 06:50:55 EST 2009


On Mon, Nov 02, 2009 at 09:01:35PM -0500, Tom Barron wrote:
> I'm doing an automated, non-interactive LAMP server install on ubuntu
> karmic using the command:
> 
>   % sudo DEBIAN_FRONTEND=noninteractive apt-get -q -y install lamp-server^
>   
> The '^' at the end effects a tasksel interaction and the
> DEBIAN_FRONTEND setting runs the whole thing in batch without any popup
> screens.
> 
> Now the next things I want to do is:
> 
>    1. set the mysql root server root password
>    2. make a database for my web server
>    3. set up a mysql admin user for that database
>    
> I hit a snag at (1) since there already appears to be a mysql root
> password set and I don't know what it is.  'mysql -u root' fails with
> 
> ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
> 
> And 'mysql -u root -p' fails because I don't know the password that
> was set.
> 
> Anyone know the way out of this conundrum?
> 
> Thanks,
> 
> - Tom
> --
> TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
> TriLUG FAQ  : http://www.trilug.org/wiki/Frequently_Asked_Questions

OK, probably the best way out of the conundrum is just to run jaunty
instead of bleeding with karmic.

I built a virgin jaunty Rackspace Cloud 256MB VPS (took only a couple
minutes to build and boot) and ran the same apt-get install command as
before.  After the LAMP install completed, no mysql root password was
set, i.e. I could successfully 'mysql -u root' without specifying a
password, then set one right away.  Just what I wanted.

Guess I'll follow up on this on the ubuntu karmic lists.

For those curious, the RS cloud machine existed for 11 minutes and 15
seconds.  I think RS will bill me $.01 since the rate for this little
VPS is $.015/hr and I have an earlier 58 minute run of the same size
machine for which I was billed $.01.  This was quicker than dowloading
a fresh jaunty ISO, loading it in virtual box, going through the GUI
install - especially because I'd be doing it at home on a pretty slow
DSL connection.

Thanks for the help, everyone.

- Tom




More information about the TriLUG mailing list