From ef538fb1d552e40bee44704e97478c0e6417956a Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Sat, 30 Dec 2023 13:11:07 +0100 Subject: [PATCH] - more init fixes --- mysql.init | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/mysql.init b/mysql.init index 00f9494..1e8ff67 100755 --- a/mysql.init +++ b/mysql.init @@ -416,11 +416,11 @@ mysqlsubsys() { for mysqldir in $DB_CLUSTERS; do mysqlstatus "$mysqldir" if [ "$MYSQL_STATUS" = "running" ]; then - touch /var/lock/subsys/mysql + touch /var/lock/subsys/mysql-@mysqlversion@ return fi done - rm -f /var/lock/subsys/mysql + rm -f /var/lock/subsys/mysql-@mysqlversion@ } mysqlinit() { @@ -496,7 +496,7 @@ mysqlinit() { PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL USERS! Start database: -$ service mysql start +$ service mysql-@mysqlversion@ start and set passwords: @@ -504,22 +504,16 @@ For 'root' user (ALL privileges, DB admin), paste command with new password: ALTER USER 'root'@'localhost' IDENTIFIED BY 'newpassword'; FLUSH PRIVILEGES; -For 'mysql_sysadmin' (RELOAD and SHUTDOWN privileges): +For 'mysql_sysadmin' (RELOAD, SHUTDOWN and REPLICATION CLIENT privileges): CREATE USER 'mysql_sysadmin'@'localhost' IDENTIFIED BY 'sysnewpassword' PASSWORD EXPIRE NEVER; -GRANT RELOAD, SHUTDOWN ON *.* TO 'mysql_sysadmin'@'localhost'; +GRANT RELOAD, SHUTDOWN, REPLICATION CLIENT ON *.* TO 'mysql_sysadmin'@'localhost'; FLUSH PRIVILEGES; Both into command: $ mysql -u root -p --ssl-mode=disabled -S $MYSQL_SOCKET -NOTE 1: -CURRENT TEMPORARY ROOT PASSWORD CAN BE FOUND IN LOG -(grep for "A temporary password is generated" string): -$MYSQL_ERRLOG - - -NOTE 2: +NOTE: mysql_sysadmin password should be placed to $MYSQL_CONFIG in mysqladmin section. See the manual for more instructions. (This user is used at logs rotation and server shutdown) @@ -546,9 +540,10 @@ shell> mysql -u root mysql mysql> show tables Try 'mysqld --help' if you have problems with paths. Setting on -logging in $MYSQL_DATA_DIR/mysqld.conf gives you a log in /var/log/mysql/mysql-8.0-query.log that -may be helpful. The latest information about MySQL is available on the -web at http://www.mysql.com/. +logging in $MYSQL_DATA_DIR/mysqld.conf gives you a log in +/var/log/mysql/@mysqlversion/query.log that may be helpful. +The latest information about MySQL is available on the web at +http://www.mysql.com/. Please check TLD Linux site for newer versions of this package. @@ -602,7 +597,7 @@ stop() { } condrestart() { - if [ ! -f /var/lock/subsys/mysql ]; then + if [ ! -f /var/lock/subsys/mysql-@mysqlversion@ ]; then msg_not_running "MySQL" RETVAL=$1 return -- 2.45.1