日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

mysql权限日志_mysql权限管理、日志管理及常用工具

發布時間:2025/3/11 数据库 56 豆豆
生活随笔 收集整理的這篇文章主要介紹了 mysql权限日志_mysql权限管理、日志管理及常用工具 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

mysqlbinlog用法如下:

mysqbinlog mysql.err ? 查詢錯誤日志

當然可以通過添加參數來查看指定內容,如:

mysqlbinlog mysql-bin.000001 ?-d test 只顯示對test數據庫的二進制日志

mysqlbinlog?mysql-bin.000001???-o 3 -r result-file 首先忽略前三個操作,并將日志結果輸出到result-file文件中

mysqlbinlog相關參數:

--base64-output[=name]

Determine when the output statements should be

base64-encoded BINLOG statements: 'never' disables it and

works only for binlogs without row-based events;

'decode-rows' decodes row events into commented SQL

statements if the --verbose option is also given; 'auto'

prints base64 only when necessary (i.e., for row-based

events and format description events); 'always' prints

base64 whenever possible. 'always' is for debugging only

and should not be used in a production system. If this

argument is not given, the default is 'auto'; if it is

given with no argument, 'always' is used.

--character-sets-dir=name

Directory for character set files.

-d, --database=name List entries for just this database (local log only).

--debug-check Check memory and open file usage at exit .

--debug-info Print some debug info at exit.

-D, --disable-log-bin

Disable binary log. This is useful, if you enabled

--to-last-log and are sending the output to the same

MySQL server. This way you could avoid an endless loop.

You would also like to use it when restoring after a

crash to avoid duplication of the statements you already

have. NOTE: you will need a SUPER privilege to use this

option.

-F, --force-if-open Force if binlog was not closed properly.

-f, --force-read Force reading unknown binlog events.

-H, --hexdump Augment output with hexadecimal and ASCII event dump.

-h, --host=name Get the binlog from server.

-l, --local-load=name

Prepare local temporary files for LOAD DATA INFILE in the

specified directory.

-o, --offset=# Skip the first N entries.

-p, --password[=name]

Password to connect to remote server.

-P, --port=# Port number to use for connection or 0 for default to, in

order of preference, my.cnf, $MYSQL_TCP_PORT,

/etc/services, built-in default (3306).

--position=# Deprecated. Use --start-position instead.

--protocol=name The protocol to use for connection (tcp, socket, pipe,

memory).

-R, --read-from-remote-server

Read binary logs from a MySQL server.

-r, --result-file=name

Direct output to a given file.

--server-id=# Extract only binlog entries created by the server having

the given id.

--set-charset=name Add 'SET NAMES character_set' to the output.

-s, --short-form Just show regular queries: no extra info and no row-based

events. This is for testing only, and should not be used

in production systems. If you want to suppress

base64-output, consider using --base64-output=never

instead.

-S, --socket=name The socket file to use for connection.

--start-datetime=name

Start reading the binlog at first event having a datetime

equal or posterior to the argument; the argument must be

a date and time in the local time zone, in any format

accepted by the MySQL server for DATETIME and TIMESTAMP

types, for example: 2004-12-25 11:25:56 (you should

probably use quotes for your shell to set it properly).

-j, --start-position=#

Start reading the binlog at position N. Applies to the

first binlog passed on the command line.

--stop-datetime=name

Stop reading the binlog at first event having a datetime

equal or posterior to the argument; the argument must be

a date and time in the local time zone, in any format

accepted by the MySQL server for DATETIME and TIMESTAMP

types, for example: 2004-12-25 11:25:56 (you should

probably use quotes for your shell to set it properly).

--stop-position=# Stop reading the binlog at position N. Applies to the

last binlog passed on the command line.

-t, --to-last-log Requires -R. Will not stop at the end of the requested

binlog but rather continue printing until the end of the

last binlog of the MySQL server. If you send the output

to the same MySQL server, that may lead to an endless

loop.

-u, --user=name Connect to the remote server as username.

-v, --verbose Reconstruct SQL statements out of row events. -v -v adds

comments on column data types.

-V, --version Print version and exit.

--open_files_limit=#

Used to reserve file descriptors for use by this program.

在使用mysqlbinlog查看二進制日志時會出現mysqlbinlog: unknown variable 'default-character-set=utf8'

解決辦法:

1、mysqlbinlog --no-defaults mysql-bin.000001

2、修改my.cnf

#default-character-set=utf8

因為mysqlbinlog會重新從my.cnf中讀取,不是從內存中讀取,使用完畢之后,再修改過來即可

總結

以上是生活随笔為你收集整理的mysql权限日志_mysql权限管理、日志管理及常用工具的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。