MySQL5.7新特性之錯(cuò)誤日志打印到操作系統(tǒng)日志文件

 通常,MySQL將錯(cuò)誤日志輸出在hostname.err文件中,但MySQL5.7可以將錯(cuò)誤日志打印到操作系統(tǒng)日志中,具體操作如下:
 MySQL服務(wù)器啟動(dòng)的時(shí)候,mysqld_safe加 --syslog參數(shù),如下:
 啟動(dòng)MySQL服務(wù):
[root@mysql log]# /usr/local/mysql/bin/mysqld_safe --defaults-file=/etc/my.cnf --syslog --user=mysql &
[1] 17994
[root@mysql log]# 2017-07-21T04:05:12.802731Z mysqld_safe Logging to syslog.
2017-07-21T04:05:12.807548Z mysqld_safe Logging to '/var/log/mysqld.log'.
2017-07-21T04:05:12.828189Z mysqld_safe Starting mysqld daemon with databases from /mysql/data
[root@mysql log]# 

查看系統(tǒng)日志:
[root@mysql log]# tail -f /var/log/messages
Jul 21 12:05:14 mysql mysqld[18451]: Server hostname (bind-address): '*'; port: 3306
Jul 21 12:05:14 mysql mysqld[18451]: IPv6 is available.
Jul 21 12:05:14 mysql mysqld[18451]:   - '::' resolves to '::';
Jul 21 12:05:14 mysql mysqld[18451]: Server socket created on IP: '::'.
Jul 21 12:05:14 mysql mysqld[18451]: Event Scheduler: Loaded 0 events
Jul 21 12:05:14 mysql mysqld[18451]: /usr/local/mysql/bin/mysqld: ready for connections.#012Version: '5.7.18-log'  socket: '/tmp/mysqld.sock'  port: 3306  Source distribution
Jul 21 12:05:14 mysql mysqld[18451]: Executing 'SELECT * FROM INFORMATION_SCHEMA.TABLES;' to get a list of tables using the deprecated partition engine. You may use the startup option '--disable-partition-engine-check' to skip this check. 
Jul 21 12:05:14 mysql mysqld[18451]: Beginning of list of non-natively partitioned tables
Jul 21 12:05:14 mysql mysqld[18451]: End of list of non-natively partitioned tables
Jul 21 12:05:14 mysql mysqld[18451]: InnoDB: Buffer pool(s) load completed at 170721 12:05:14

分享題目:MySQL5.7新特性之錯(cuò)誤日志打印到操作系統(tǒng)日志文件
網(wǎng)站路徑:http://www.muchs.cn/article18/gdgcgp.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供小程序開發(fā)、軟件開發(fā)搜索引擎優(yōu)化、Google、網(wǎng)頁(yè)設(shè)計(jì)公司、動(dòng)態(tài)網(wǎng)站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

h5響應(yīng)式網(wǎng)站建設(shè)