How to narrow down the ibdata1 file of MYSQL database and clear error logs

Source: Internet
Author: User

MYSQL database ibdata1 file reduction and Error Log clearing methods mysql ibdata1 stores data, indexes, and so on, is the most important data of MYSQL. if you do not store the data separately, the size of the file will easily reach G, or even 10 + G. for some applications, this file is not suitable, so we need to narrow down the file. method: Separate data files. step: 1. back up the database from the command line to MySQL Server 5.0 \ bin to back up all the databases, and execute the command mysqldump-q-uusername-pyourpassword -- add-drop-table-all-databases>/all. after SQL completes this step, stop the database service. 2. modify the mysql configuration file my. INI file, add the following innodb_file_per_table configuration to use a separate innoDB file for each table, modify/etc/my. cnf file 3. delete original data file delete original ibdata 1 file and Log File ib_logfile *, delete the application database folder under the data Directory (do not delete the mysql folder) 4. restore database start Database Service from command line enter MySQL Server 5.0 \ bin restore all databases, Execute Command mysql-uusername-pyourpassword </all. after completing the preceding steps, you can see that the new ibdata1 file is only dozens of MB, and the data and indexes are converted into small ibd files for a single table. Mysql: log management: the mysql error log records the running status of the basic processes on the mysqd server. Command and configuration options: [--] log_error [= filen_ame] -- generate a new error log file when calling flush logs. Add the "old" suffix command and configuration options to the old file name: [--] log_warnings -- control mysql to record warning information to the error log file dynamic system variable: log_warnings -- control mysql to record warning information to the error log file command options: -- console redirects error logs to stderr -- generally, no command is specified on the screen, and the configuration options are [--] log_error [= filen_ame] -- specify commands and configuration options for error logs: [--] skip-syslog -- no error log is recorded

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.