Wamp Server放入dropbox,禁用数据文件夹中的日志
我想做的事情很简单。我想要 www 和 mysql/data 文件夹同步。
我已成功进行更改,首先我将 www 文件夹指向 dropbox,然后更改 my.ini
datadir=C:/Dropbox/web/mysql/data
(注意:我知道有些人可能会评论,mysql数据同步不好,并尝试使用远程mysql数据库,但我的问题是我没有互联网一直连接,或者我的互联网连接很差/慢),我只是喜欢本地主机速度:)
现在我的问题是,在我的 C:/Dropbox/web/mysql/data 中有很多 mysql-bin.0000xy 文件。我如何删除它,并完全禁用 mysql 中的日志。
我曾尝试过。 在 mysql run 中登录到 root
SHOW VARIABLES;
SET sql_log_bin=0;
SET GLOBAL expire_logs_days=10;
FLUSH LOGS;
PURGE BINARY LOGS TO 'mysql-bin.000001';
PURGE BINARY LOGS BEFORE '2011-12-31 23:59:59';
日志文件仍然出现在 C:/Dropbox/web/mysql/data 中
接下来我尝试了这个
SHOW BINARY LOGS;
Error Code : 1381
You are not using binary logging
我想要的只是删除 mysql 数据文件夹中的日志文件,这样我就可以节省空间,并且dropbox 不需要同步它。
What I want to do is pretty simple. I would like to have sync for www and mysql/data folder sync.
I have successful make the change, first I point www folder to dropbox, and change the my.ini
datadir=C:/Dropbox/web/mysql/data
(note: I know some ppls might comment, it is not good to have the mysql data sync, and try to use remote mysql database, but my problem is I do not have internet connection all the time, or my internet connection is pretty bad / slow), I just like localhost speed :)
Now my problem is, inside my C:/Dropbox/web/mysql/data there is a lot mysql-bin.0000xy file. How I can remove it, and totally disable the log in mysql.
I had tried.
login to root in mysql run
SHOW VARIABLES;
SET sql_log_bin=0;
SET GLOBAL expire_logs_days=10;
FLUSH LOGS;
PURGE BINARY LOGS TO 'mysql-bin.000001';
PURGE BINARY LOGS BEFORE '2011-12-31 23:59:59';
The log files still appear inside C:/Dropbox/web/mysql/data
Next I tried this
SHOW BINARY LOGS;
Error Code : 1381
You are not using binary logging
What I want just get rid for the log file inside my mysql data folder, so I can save the space, and dropbox do not need to sync it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
http://systems.takizo.com/ 2009/08/23/how-to-remove-mysql-binary-log/
清理主服务器上的二进制日志
具有 SUPER 权限的客户端可以通过使用
语句。
http://systems.takizo.com/2009/08/23/how-to-remove-mysql-binary-log/
To clean up Binary Log on Master Server
A client that has the SUPER privilege can disable binary logging of its own statements by using a
statement.