diff --git a/bin/vhost-mysql-db-add.sh b/bin/vhost-mysql-db-add.sh index 5b10525..f2ed88e 100755 --- a/bin/vhost-mysql-db-add.sh +++ b/bin/vhost-mysql-db-add.sh @@ -80,9 +80,10 @@ if [[ -n $write ]]; then chmod 640 /srv/www/$domain/.my.cnf echo '[client]' > /srv/www/$domain/.my.cnf echo "host=127.0.0.1" >> /srv/www/$domain/.my.cnf - echo "database=$database" >> /srv/www/$domain/.my.cnf echo "user=$username" >> /srv/www/$domain/.my.cnf echo "password=$password" >> /srv/www/$domain/.my.cnf + echo '[mysql]' >> /srv/www/$domain/.my.cnf + echo "database=$database" >> /srv/www/$domain/.my.cnf touch /home/$vhost_username/.my.cnf chown $vhost_username:$vhost_username /home/$vhost_username/.my.cnf chmod 640 /home/$vhost_username/.my.cnf