]> git.pld-linux.org Git - packages/mysql.git/commitdiff
use mysqld.conf when fetching slave status
authorElan Ruusamäe <glen@delfi.ee>
Mon, 22 Apr 2013 10:23:25 +0000 (13:23 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Mon, 22 Apr 2013 10:25:01 +0000 (13:25 +0300)
we need -u mysql to get super privileges, this is the simpliest way (and
works by default in pld)

service mysql status gives such error
ERROR 1227 (42000) at line 1: Access denied; you need the SUPER,REPLICATION CLIENT privilege for this operation

which works fine from commandline if you have ~/.my.cnf specifing user=mysql:
$ mysql -S /var/lib/mysql/mysqldb/mysql.sock -e show slave status\G

fine tuning could add special user for this purpose only

mysql.init
mysqld.conf

index 932768310ab46030a53acd4d861836101384f9b7..f5cc30fea348d6dac77846d6547f13dca4e0d3e1 100755 (executable)
@@ -359,7 +359,7 @@ mysqlstop() {
 # uses MYSQL_SOCKET - path to mysql socket
 slave_status() {
        # see if slave status can be reported
-       local err=0 slave_status=$(mysql -S $MYSQL_SOCKET -e 'show slave status\G')
+       local err=0 slave_status=$(mysql --defaults-file="$MYSQL_CONFIG" --socket="$MYSQL_SOCKET" -e 'show slave status\G')
        if [ -z "$slave_status" ]; then
                # slave not setup
                return
index 9df699ed46d6226328d04af2a908c93f98f9c842..c4f7331dfd3099d2af088f45e118d3108d2810a3 100644 (file)
@@ -222,3 +222,8 @@ innodb_log_buffer_size=1M
 [mysqladmin]
 user        = mysql_sysadmin
 password    =
+
+# used by initscript to fetch slave status
+[mysql]
+user        = mysql
+password    =
This page took 0.066983 seconds and 4 git commands to generate.