mysql日志文件在哪 如何修改MySQL日志文件位置
时间:2024-01-22 22:09:14
MySQL日志文件相信大家都有很多的了解,MySQL日志文件一般在:/var/log/mysqld.log,下面就教您修改MySQL日志文件位置的方法,供您参考。
今天需要改MySQL日志文件的位置,发现在/etc/my.cnf中怎么也改不了。
后来发现MySQL日志位是指定的:
[root@localhost etc]# ps aux|grep mysqld
root 11830 0.5 0.0 4524 1204 pts/0 S 03:03 0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/data/mysql --socket=/var/lib/mysql/mysql.sock --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid
mysql 11890 3.7 0.1 40456 9076 pts/0 Sl 03:03 0:00 /usr/libexec/mysqld --basedir=/usr --datadir=/data/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-external-locking --port=3306 --socket=/var/lib/mysql/mysql.sock
root 11909 0.0 0.0 3908 664 pts/0 S+ 03:03 0:00 grep mysqld
chkconfig --list发现是chkconfig on指定的,天是
vim /etc/init.d/mysqld得知这里的已经配置
get_mysql_option mysqld datadir "/var/lib/mysql"
datadir="$result"
get_mysql_option mysqld socket "$datadir/mysql.sock"
socketfile="$result"
get_mysql_option mysqld_safe log-error "/var/log/mysqld.log"
errlogfile="$result"
get_mysql_option mysqld_safe pid-file "/var/run/mysqld/mysqld.pid"
mypidfile="$result"
更改这里应该就行了
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Python实现自动化处理PDF文件的方法详解
![](https://img.aspxhome.com/file/2023/5/70745_0s.jpg)
修复 Mac brew 安装 mongodb 报 Error: No available formula with the name ‘mongodb’ 问题详解
微信小程序-详解数据缓存
![](https://img.aspxhome.com/file/2023/0/136130_0s.png)
pymongo中group by的操作方法教程
css基础教程属性篇
![](https://img.aspxhome.com/file/UploadPic/20087/23/200872312564485s.jpg)
PHP禁止页面缓存的代码
PHP闭包定义与使用简单示例
深入理解Python中的super()方法
在Vue项目中使用Typescript的实现
![](https://img.aspxhome.com/file/2023/7/133137_0s.png)
如何使用Python进行OCR识别图片中的文字
JavaScript Alert通用美化类
Pytest中skip skipif跳过用例详解
![](https://img.aspxhome.com/file/2023/0/87530_0s.png)
Python之多线程爬虫抓取网页图片的示例代码
![](https://img.aspxhome.com/file/2023/2/121422_0s.png)
mysql优化配置参数
Gin golang web开发模型绑定实现过程解析
详解SQL中的DQL查询语言
![](https://img.aspxhome.com/file/2023/3/94473_0s.png)
python re正则表达式模块(Regular Expression)
python实现加密的方式总结
破解安装Pycharm的方法
![](https://img.aspxhome.com/file/2023/5/125125_0s.png)