Tag Archives: MySQL

list slave mysql

show slave mysql

mysql> SELECT * FROM information_schema.PROCESSLIST AS p WHERE p.COMMAND = 'Binlog Dump';

+---------+------+-------------------------+------+-------------+---------+---------------------------------------------------------------+------+
| ID | USER | HOST | DB | COMMAND | TIME | STATE | INFO |
+---------+------+-------------------------+------+-------------+---------+---------------------------------------------------------------+------+
| 3973053 | user | srv-mysql-slave1:53014 | NULL | Binlog Dump | 3743978 | Master has sent all binlog to slave; waiting for more updates | NULL |
+---------+------+-------------------------+------+-------------+---------+---------------------------------------------------------------+------+

ERROR 1698 (28000): Access denied for user ‘root’@’localhost’

MariaDB [mysql]> SELECT User, Host, plugin FROM mysql.user;
+------+-----------+-------------+
| User | Host | plugin |
+------+-----------+-------------+
| root | localhost | unix_socket |

mysql> USE mysql;
mysql> UPDATE user SET plugin='mysql_native_password' WHERE User='root';
mysql> FLUSH PRIVILEGES;
mysql> exit;

MariaDB [mysql]> SELECT User, Host, plugin FROM mysql.user;
+------+-----------+-----------------------+
| User | Host | plugin |
+------+-----------+-----------------------+
| root | localhost | mysql_native_password |
+------+-----------+-----------------------+

service mysql restart