mysql创建用户并授权Repl_slave_priv和Repl_client_priv
CREATE USER 'test'@'localhost' IDENTIFIED BY 'test'; FLUSH PRIVILEGES; GRANT REPLICATION CLIENT ON *.* TO test@localhost IDENTIFIED BY 'test'; GRANT REPLICATION SLAVE ON *.* TO test@localhost IDENTIFIED BY 'test'; RESET SLAVE; # 给予本地访问 GRANT ALL PRIVILEGES ON 库名.* TO test@localhost IDENTIFIED BY 'test'; # 给予所有外网访问 GRANT ALL PRIVILEGES ON 库名.* TO test@% IDENTIFIED BY 'test'; FLUSH PRIVILEGES;