mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-11 04:05:40 +03:00
services.mysql: make sql statements consistent uppercase
This commit is contained in:
parent
534f90a262
commit
e00090dddf
1 changed files with 5 additions and 5 deletions
|
@ -469,7 +469,7 @@ in
|
|||
( echo 'CREATE DATABASE IF NOT EXISTS `${database.name}`;'
|
||||
|
||||
${lib.optionalString (database.schema != null) ''
|
||||
echo 'use `${database.name}`;'
|
||||
echo 'USE `${database.name}`;'
|
||||
|
||||
# TODO: this silently falls through if database.schema does not exist,
|
||||
# we should catch this somehow and exit, but can't do it here because we're in a subshell.
|
||||
|
@ -488,7 +488,7 @@ in
|
|||
${lib.optionalString (cfg.replication.role == "master") ''
|
||||
# Set up the replication master
|
||||
|
||||
( echo "use mysql;"
|
||||
( echo "USE mysql;"
|
||||
echo "CREATE USER '${cfg.replication.masterUser}'@'${cfg.replication.slaveHost}' IDENTIFIED WITH mysql_native_password;"
|
||||
echo "SET PASSWORD FOR '${cfg.replication.masterUser}'@'${cfg.replication.slaveHost}' = PASSWORD('${cfg.replication.masterPassword}');"
|
||||
echo "GRANT REPLICATION SLAVE ON *.* TO '${cfg.replication.masterUser}'@'${cfg.replication.slaveHost}';"
|
||||
|
@ -498,9 +498,9 @@ in
|
|||
${lib.optionalString (cfg.replication.role == "slave") ''
|
||||
# Set up the replication slave
|
||||
|
||||
( echo "stop slave;"
|
||||
echo "change master to master_host='${cfg.replication.masterHost}', master_user='${cfg.replication.masterUser}', master_password='${cfg.replication.masterPassword}';"
|
||||
echo "start slave;"
|
||||
( echo "STOP SLAVE;"
|
||||
echo "CHANGE MASTER TO MASTER_HOST='${cfg.replication.masterHost}', MASTER_USER='${cfg.replication.masterUser}', MASTER_PASSWORD='${cfg.replication.masterPassword}';"
|
||||
echo "START SLAVE;"
|
||||
) | ${cfg.package}/bin/mysql -u ${superUser} -N
|
||||
''}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue