mysql 5.7.18(主从)
Last_IO_Error: Master command COM_REGISTER_SLAVE failed: Access denied for user 'repl'@'xxx.xxx.xxx.xxx' (using password: YES) (Errno: 1045)
Run Code Online (Sandbox Code Playgroud)
2017-05-29T16:40:39.718290Z 213 [Note] Aborted connection 213 to db: 'unconnected' user: 'repl' host: 'xxx.xxx.xxx.xxx' (Got an error reading communication packets)
Run Code Online (Sandbox Code Playgroud)
但是,如果我像这样从从服务器命令行登录,则没有错误,并且从服务器可以完美地连接到主服务器。所以肯定是主从配置有什么不对的
mysql -h xxx.xxx.xxx.xxx -u repl -pxxxxxxxxxxxx
mysql> show grants;
+--------------------------------------------+
| Grants for repl@xxx.xxx.xxx.xxx |
+--------------------------------------------+
| GRANT USAGE ON *.* TO 'repl'@'xxx.xxx.xxx.xxx' |
+--------------------------------------------+
1 row in set (0.00 sec)
Run Code Online (Sandbox Code Playgroud)
CREATE USER 'repl'@'xxx.xxx.xxx.xxx' IDENTIFIED BY 'xxxxx'; …
Run Code Online (Sandbox Code Playgroud) 在大表上执行期间,OPTIMIZE TABLE
该过程似乎“锁定”了表。您可以采取一些措施来加快该过程或防止它“锁定”表吗?
执行时应用程序/服务超时OPTIMIZE TABLE
mysql 5.7.36
我的cnf
[mysqld]
# GENERAL #
user = mysql
port = 3306
default_storage_engine = InnoDB
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
# SAFETY #
max_allowed_packet = 16M
max_connect_errors = 1000000
skip_name_resolve
sql_mode = STRICT_ALL_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO
sysdate_is_now = 1
symbolic_links = 0
# DATA STORAGE #
datadir = /var/lib/mysql/
# BINARY LOGGING #
server_id = 1
log_bin = /var/lib/mysql/mysql-bin
expire_logs_days = 10
sync_binlog = 1
log_bin_trust_function_creators= 1
binlog_format = ROW
master_verify_checksum = 1
# …
Run Code Online (Sandbox Code Playgroud)