From d5d5b680f8ebcc17b9cf2cc9e32af62396a04406 Mon Sep 17 00:00:00 2001 From: Chmouel Boudjnah Date: Thu, 13 Oct 2011 18:45:42 +0100 Subject: [PATCH] Set sensible default for mysql client Using $HOME/.my.cnf to make easier for user to connect to mysql client. --- stack.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/stack.sh b/stack.sh index 38560e6..8c5b7ee 100755 --- a/stack.sh +++ b/stack.sh @@ -318,6 +318,16 @@ mysql-server-5.1 mysql-server/root_password_again password $MYSQL_PASS mysql-server-5.1 mysql-server/start_on_boot boolean true MYSQL_PRESEED + if [[ ! -e $HOME/.my.cnf ]]; then + cat <$HOME/.my.cnf +[client] +user=$MYSQL_USER +password=$MYSQL_PASS +host=$MYSQL_HOST +EOF + chmod 0600 $HOME/.my.cnf + fi + # Install and start mysql-server sudo apt-get -y -q install mysql-server # Update the DB to give user ‘$MYSQL_USER’@’%’ full control of the all databases: