How to automate the installation of MySQL 5.6 and above

Posted by Matt Bryson on 14-Apr-2016 13:24:59

With the release of MySQL 5.6, there was no longer a default user account with an empty password. For security reasons the root account is now allocated a random password when MySQL is installed, which is written to a log file.

You then look up the password from the log file, and use it to login and change it to something else...

$ sudo grep 'temporary password' /var/log/mysqld.log 
$ mysqladmin -u root --password=RANDOM_PASSWORD_FROM_LOG password myNewSuperSecretPassword1!

This is all well and good, unless you are automating deployment of MySQL. We use vagrant/ansible to spin up our local dev servers, and as soon as we upgraded MySQL, all our MySQL commands started failing as they could no longer authenticate.

There was no obvious way to install with a predefined password, or no password, so we came up with the following to automate setting up MySQL.

Read More

Topics: Ansible, Deployment, Database, yum, CentOS, Linux, MySQL, Vagrant, Provisioning, Technology

Vagrant up on existing server can not connect to mongo db : { [MongoError: connect ECONNREFUSED] name: 'MongoError', message: 'connect ECONNREFUSED' }

Posted by Matt Bryson on 26-Aug-2015 16:37:33

We often get an issue with our MEAN vagrant dev environments where a previously working server will fail to connect to the mongo db the next time a developer does vagrant up

Read More

Topics: MongoDB, Linux, Vagrant, Bash

yum repomd.xml does not match metalink for epel - or other repository

Posted by Matt Bryson on 12-Sep-2014 10:50:46

We had this error the other day when running our vagrant script (centOS box):

[Errno -1] repomd.xml does not match metalink for epel
Trying other mirror.

This tried and failed on every single mirror, and basically hung our deployment.

Read More

Topics: Ansible, Deployment, yum, CentOS, Linux, Vagrant, Provisioning