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中讀取,不是從內存中讀取,使用完畢之后,再修改過來即可

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/540049.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/540049.shtml
英文地址,請注明出處:http://en.pswp.cn/news/540049.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

Juicer.js模板引擎問題

由于jsp中的EL表達式語法和jquery.tmpl十分類似,,所以單純的使用${name},數據是渲染不上tmpl的. SO.. 要加上轉義: ${${}amount} 或者 \${amount} 轉載于:https://www.cnblogs.com/fighxp/p/7890288.html

python把回車作為輸入_python將回車作為輸入內容的實例

當input輸入內容的時候,許多情況下輸入回車鍵另起一行輸入,但是這時候Pycharm就執行程序,然后結束,導致無法繼續輸入內容。 原因:Python默認遇到回車的時候,輸入結束。所以我們需要更改這個提示符,在遇到其他字符的時候,輸入才結束。 比如有一個任務: 請輸入文件名:憫…

ubuntu下修改時區和時間

applications-Accessories-Time & Date-點下鎖-輸入密碼-把時區改成上海(這個要點圖中國與朝鮮之間的彎處才行,寫不生效)-Set the time 選Manually-改下時間、日期-直接關閉即可(重啟后依然生效) 注:從電腦上邊的時間處-Time …

python提供了9個基本的數值運算操作符_Python學習筆記(三)Python基本數字類型及其簡單操作(1)...

一、數字類型表示數字或數值的數據類型稱為數字類型,Python語言提供3種數字類型:整數、浮點數和復數,分別對應數學中的整數、實數和復數,下面就一起來了解一下他們吧!1.整數類型整數類型與數學中整數的概念一致,整數類…

hdu 5139 數據的離線處理

所謂的數據離線處理,就是將所有的輸入數據全部讀入后,在進行統一的操作,這樣當然有好處,比如讓你算好多數的階層,但是輸入的每個數是沒有順序的,其實跟可以線性的解決,但是由于沒有順序的輸入&a…

vue 后臺返回的文件流進行預覽_vue實現下載文件流完整前后端代碼

這篇文章主要為大家詳細介紹了vue實現下載文件流完整前后端代碼,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下使用Vue時,我們前端如何處理后端返回的文件流首先后端返回流,這里我把流…

OSPF-5類LSA和4類LSA

# 5類LSA :外部路由前綴 ASBR的router_id IOU5#sh ip ospf data extOSPF Router with ID (5.5.5.5) (Process ID 1)Type-5 AS External Link StatesLS age: 71Options: (No TOS-capability, DC, Upward)LS Type: AS External LinkLink State ID: 10.1.55.0 (Extern…

2014年9月計算機二級mysql真題_2017年9月全國計算機二級MySQL考試章節練習題

2017年9月全國計算機二級MySQL考試章節練習題計算機二級考試成績在“及格”,即60~89分者,由教育部考試中心發合格證書,考試成績在“優秀”,即90~100分者,由教育部考試中心發優秀證書。這是小編給大家提供的2017年9月全…

macOS 10.11.* 安裝scrapy

1.安裝brew,然后修改brew源為某高校 2.更新python brew install python 3.安裝pip 4.安裝scrapy,這里肯定會有一個坑,之前在網上看到10.11開啟了什么rootless的東西, 會遇到安裝six失敗,原因是由于系統安裝了six&#…

eclipse使用小技巧

1. eclipse自帶內存監視及回收插件 菜單 Window > Preferences > General > 右邊,把 Show Heap Status 打上勾就會在右下角任務欄顯示內存監視器,并且可以點擊內存回收。 2. http://www.eclipse.org/downloads/3. 摘錄熱鍵篇:Template&#xff…

mysql @ $_mysql常見筆試題

一、Mysql常見筆試題1、Mysql 中有哪幾種鎖?(1)表級鎖:開銷小,加鎖快。不會出現死鎖,鎖定粒度大,發生鎖沖突的概率高,并發度低。(2)行級鎖:開銷大,加鎖慢。會出現死鎖,鎖…

mysql無法與外部健形成約束_MySQL Rails:錯誤:150“外鍵約束不正確”

我試圖遷移我的Rails MySQL數據庫,我收到以下錯誤:ActiveRecord :: StatementInvalid:Mysql2 :: Error:無法創建表development.comments(錯誤:150“外鍵約束形成錯誤”):CREATE TABLE注釋(id int AUTO_INCR…

按角度構建切變矩陣

切變是坐標系的變換,非均勻的拉伸。切變時候,角度變化,但是面積或體積不變。也可以理解為坐標軸間的角度變化,造成的扭曲。 如下圖,這是x坐標根據y坐標的切變,機器人的y坐標沒有變化,只有x坐標變…

java 語法_Java基礎語法

標識符定義給包,類,方法,變量起名字的符號。組成規則標識符由字母、數字、下劃線、美元符號組成。命名原則:見名知意包名:全部小寫,多級包用.隔開。舉例:com.jourwon類、接口:一個單詞首字母大寫,多個單詞每個單詞的首字母大寫。舉…

POJ1061:青蛙的約會——題解

http://poj.org/problem?id1061 Description 兩只青蛙在網上相識了,它們聊得很開心,于是覺得很有必要見一面。它們很高興地發現它們住在同一條緯度線上,于是它們約定各自朝西跳,直到碰面為止。可是它們出發之前忘記了一件很重要的…

用了mysql報oracle錯誤_mysql數據遷移到oracle錯誤總結

最近處理一個需求,使用腳本方式將mysql里的數據遷移到oracle中。處理思路主要是利用mysqldump導出的insert dump文件,oracle中建立相同表結構執行insert。記錄本次操作中遇到的問題與處理方式:1、超4000字節字符串導入問題描述oracle varchar…

運行Hadoop自帶的wordcount單詞統計程序

1.使用示例程序實現單詞統計 (1)wordcount程序 wordcount程序在hadoop的share目錄下,如下: 123456789[rootleaf mapreduce]# pwd /usr/local/hadoop/share/hadoop/mapreduce[rootleaf mapreduce]# ls hadoop-mapreduce-client-app…

java for 線程_如何在for循環中使用多線程

import java.util.concurrent.Executor;import java.util.concurrent.Executors;public class Test {private final static Executor executor Executors.newCachedThreadPool();//啟用多線程public static void main(String[] args) {for(int i0;i<3;i){final int ji; …

office2010安裝出現錯誤1935的解決方法

安裝Office2010 professional plus 2010過程中彈出錯誤&#xff0c;提示錯誤 1935&#xff0c;安裝程序集組件的過程中發生錯誤。HRESULT:0x800070BC9 如下圖所示&#xff1a; 這個錯誤是由于電腦.net framework 未安裝或安裝有錯誤導致的。解決方法為&#xff1a;下載.net fra…

java linux 服務_java項目部署Linux服務器幾種啟動方式總結經驗

一&#xff1a;兩種部署包&#xff1a;部署之前先說下兩種包&#xff0c;java項目部署到服務器一般有用war包的&#xff0c;也有用jar包的&#xff0c;微服務spring-cloud普及后大部分打包都是jar&#xff0c;部署之前先搞清楚自己要打war包還是jar包&#xff0c;下面小介紹兩種…