Skip to content

Commit

Permalink
#65 - Add .my.cnf to user home to allow credentialless login's for cl…
Browse files Browse the repository at this point in the history
…ients
  • Loading branch information
johanjanssens committed May 30, 2022
1 parent 7629270 commit 084e41f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion config/s6/cont-init.d/110-mysql.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,12 @@ if [[ ! -f $MYSQL_VOLUME/mysql.ibd ]]; then
chmod 1777 $MYSQL_VOLUME

/usr/sbin/mysqld --initialize-insecure --datadir=${MYSQL_VOLUME}
fi
fi

# Create option file to allow passwordless login for clients
# https://dev.mysql.com/doc/refman/8.0/en/option-files.html
USER_FILE=~/.my.cnf
echo '[client]' >> $USER_FILE
echo "user=${MYSQL_USER}" >> $USER_FILE
echo "password=${MYSQL_PASS}" >> $USER_FILE
chmod 0400 ~/.my.cnf

0 comments on commit 084e41f

Please sign in to comment.