Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用报错 #116

Open
luban-130 opened this issue Sep 14, 2024 · 0 comments
Open

使用报错 #116

luban-130 opened this issue Sep 14, 2024 · 0 comments

Comments

@luban-130
Copy link

数据库版本:mysql5.7.16
按照说明给普通用户授权,执行binlog日志解析命令
python binlog2sql.py -h127.0.0.1 -P3306 -ulu -d zdgs-cloud --start-file='/var/log/mysql/binlog/mysql-bin.000033'
报错如下:
Traceback (most recent call last):
File "binlog2sql.py", line 149, in
back_interval=args.back_interval, only_dml=args.only_dml, sql_type=args.sql_type)
File "binlog2sql.py", line 46, in init
self.connection = pymysql.connect(**self.conn_setting)
File "/usr/lib/python2.7/site-packages/pymysql/init.py", line 90, in Connect
return Connection(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 706, in init
self.connect()
File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 945, in connect
self.autocommit(self.autocommit_mode)
File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 760, in autocommit
self._send_autocommit_mode()
File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 778, in _send_autocommit_mode
self._read_ok_packet()
File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 767, in _read_ok_packet
pkt = self._read_packet()
File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 1014, in _read_packet
packet.check_error()
File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 393, in check_error
err.raise_mysql_exception(self._data)
File "/usr/lib/python2.7/site-packages/pymysql/err.py", line 107, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.InternalError: (1184, u"Aborted connection 1742 to db: 'unconnected' user: 'lu' host: 'iZ8vb0gp5e8fybelqtsauuZ' (init_connect command failed)")

使用root用户报错如下
python binlog2sql.py -h 127.0.0.1 -P3306 -uroot --start-file='/var/log/mysql/binlog/mysql-bin.000033'
Password:
Traceback (most recent call last):
File "binlog2sql.py", line 149, in
back_interval=args.back_interval, only_dml=args.only_dml, sql_type=args.sql_type)
File "binlog2sql.py", line 53, in init
raise ValueError('parameter error: start_file %s not in mysql server' % self.start_file)
ValueError: parameter error: start_file /var/log/mysql/binlog/mysql-bin.000033 not in mysql server

binlog日志权限如下
ll /var/log/mysql/binlog/
total 4692
-rwxrwxrwx 1 root root 887 Sep 14 08:50 biglong_trx.txt
-rwxrwxrwx 1 root root 4784400 Sep 14 08:50 binlog_status.txt
-rwxrwxrwx 1 mysql mysql 2615 Sep 14 13:38 mysql-bin.000033
-rwxrwxrwx 1 mysql mysql 783 Sep 14 13:40 mysql-bin.000034
-rwxrwxrwx 1 mysql mysql 78 Sep 14 13:38 mysql-bin.index

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant