WAMP server. Very large data directory in MySQL?

寵の児 提交于 2019-12-03 08:42:49

问题


I have problem with wammp server. In directory "..\WampServer\bin\mysql\mysql5.5.8\data" was created files with very large size. Full size of this directory is 50GB. What is these files? How can I fix this problem?

The names of files are:

mysql-bin.000001
mysql-bin.000002
................
mysql-bin.000227

The size of all files is 49GB

Thanks in advance!


回答1:


By default whenever you make a change to a MySQL database it creates a log of the query and stores it in a file simlare to mysql-bin.000001. The MySQL database does this so that you can recover or replicate a database. Most applications this is a good things to have enabled just like doing regular backups.

If you want to disable MySQL from creating these binary logs:

  1. Open my.ini
  2. Search for this line log-bin=mysql-bin
  3. Comment this line out by adding a hash mark: # log-bin=mysql-bin
  4. Save and restart the MySQL database

You can now safely delete these files from that directory.




回答2:


I did another thing on my wamp... http://dev.mysql.com/doc/refman/5.0/en/purge-binary-logs.html

Start a command prompt and goto directory wamp\bin\mysql\mysql5.5.16 or whatever version number you got

type:

mysql.exe -u root
SHOW BINARY LOGS;

a list with all the log files will be show up. We need the last one. In my case was mysql-bin.000412

so i typed

PURGE BINARY LOGS TO 'mysql-bin.000412';

and you are ok!



来源:https://stackoverflow.com/questions/10444191/wamp-server-very-large-data-directory-in-mysql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!