From e733374a749a36e43daa7891a6fe6897b3006c5e Mon Sep 17 00:00:00 2001 From: Ueli Banholzer Date: Sat, 14 Nov 2015 21:20:29 +0100 Subject: [PATCH] feat(mariadb): adding .my.cnf to root and vagrant user this let the user easier connect to the database --- scripts/mariadb.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/scripts/mariadb.sh b/scripts/mariadb.sh index f4eaca00..f3f5205f 100644 --- a/scripts/mariadb.sh +++ b/scripts/mariadb.sh @@ -43,3 +43,26 @@ if [ $2 == "true" ]; then service mysql restart fi + +# Add .my.ini file +cat <> ~/.my.cnf +[client] +user=root +password="$1" + +[mysql] +user=root +password="$1" + +[mysqldump] +user=root +password="$1" + +[mysqldiff] +user=root +password="$1" +EOT +chmod 600 ~/.my.cnf +cp ~/.my.cnf /home/vagrant +chown vagrant:vagrant /home/vagrant/.my.cnf +chmod 600 /home/vagrant/.my.cnf