我在my.cnf中设置参数
log = /tmp/mysqld.sql用来记录目前数据库中执行的sql语句,现在因为这个mysqld.sql文件过大,我想清空里面的内容重新记录sql日志,但是试用flush logs却清空不了,请问应该如何对这样的日志进行清空,谢谢。
log = /tmp/mysqld.sql用来记录目前数据库中执行的sql语句,现在因为这个mysqld.sql文件过大,我想清空里面的内容重新记录sql日志,但是试用flush logs却清空不了,请问应该如何对这样的日志进行清空,谢谢。
解决方案 »
- MYSQL占用CPU很高?请教配置
- MySql批量插入 .Net的
- hash分区进而进行子分区问题
- 如何用not in 代替not exists?一题作业?
- SOL领域讨论: MySQL InnoDB 的性能问题
- mysql4.0.14b的连接错误
- mysql数据库中列的限制的问题,我想设计一个有360个字段的表,是否合理?
- 杭州博讯软件有限公司招聘PHP+MYSQL 程序员
- :我用mysql连接mysql server时出现一个“host xxx.xxx.xxx.xx is not allowed to connec to this mysql server“,请问为什么??谢谢
- 按uidList顺序如何批量得到返回按照原有顺序得到UserList
- MYSQL 语名 引号 区别??
- MySQL manager or server PID file could not be found!
shell> mv host_name.log host_name-old.log
shell> mysqladmin flush-logs
shell> cp host_name-old.log backup-directory
shell> rm host_name-old.log
Before 5.1.3, you cannot rename a log file on Windows while the server has it open. You must stop the server and rename the file, and then restart the server to create a new log file. As of 5.1.3, this applies only to the error log. However, a stop and restart can be avoided by using FLUSH LOGS, which causes the server to rename the error log with an -old suffix and open a new error log.
As of MySQL 5.1.12, you can disable the general query log at runtime:
SET GLOBAL general_log = 'OFF';
With the log disabled, rename the log file externally; for example, from the command line. Then enable the log again:
SET GLOBAL general_log = 'ON';
This method works on any platform and does not require a server restart.
1.rm -rf mysqld.sql
2.vi mysqld.sql
3.chown mysql:mysql mysqld.sql不知道这样做是否可以。
不过最简单的应该是1楼说的那样 直接删除就可以了