]> 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>
Thu, 14 Nov 2013 09:21:12 +0000 (11:21 +0200)
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 12f692dd943d172f484cc97c1f3af79e1f2e7b43..6fd8002add979ad15d11457be0e2ce034c616d17 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 80a4dfecb2836ab116cd9acfb872134fd412c4ee..8fb97f460d71a324c87d00b8310314f666520cbc 100644 (file)
@@ -237,3 +237,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.03792 seconds and 4 git commands to generate.