MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Rob Wultsch Date:July 28 2010 6:49am
Subject:Re: Automate Install/Configuration of MySQL on Linux
View as plain text  
On Tue, Jul 27, 2010 at 1:56 PM, Todd E Thomas <todd_dsm@stripped> wrote:
> I'm looking for automation direction...
> I've found many packages that sit on top of MySQL. For the purposes of
> consistency I'd like to automate these installs.
> I've been able to automate the install and configuration of everything
> except the mysql part.
> I'm using CentOS 5.5. Installing/verifying is no big deal.
> It's the MySQL configuration that's holding me up.
> Basically I've created an expect script. It works 99% but it's a PITA to
> finish. Here's what I'd like to accomplish:
>  *Set the default admin password
>    # mysqladmin -u root password 'root-password'
>  *login to mysql
>    mysql> mysql -u root -p
>  *Drop the anonymous accounts
>    mysql> DELETE FROM mysql.user WHERE user = '';
>  *Sync all of the root passwords
>    mysql> UPDATE mysql.user SET Password = PASSWORD('root-password')
> User = 'root';
>  *Remove the test database:
>    mysql>  drop database test;
> In another script I would like to create databases for specific packages.
> EG:
> Concrete5, for example needs:
> 'admin'@'localhost' IDENTIFIED BY 'admin-password';
> If there is a better way to do this than using expect I would greatly
> appreciate any pointers in the right direction. Bash is comfortable for me
> and perl is within reach. I'm not much versed in anything else right now.

If you are serious about spending time and doing automation well then
Puppet or cfengine would be the way to go.

As for the basic tasks that you describe, have you considered
modifying the rpm/deb/whatever to distribute a data dir with whatever
you want?

In addition, do you really need expect? Could you get the same effect
with good use of the sleep command inside bash?

Rob Wultsch
Automate Install/Configuration of MySQL on LinuxTodd E Thomas27 Jul
  • Re: Automate Install/Configuration of MySQL on LinuxRob Wultsch28 Jul
Re: Automate Install/Configuration of MySQL on LinuxTodd E Thomas29 Jul