Skip to main content

How To Enable Binary Logs In MYSQL Server In Linux

The binary log contains events that describe database changes such as table creation operations or changes to table data. It also contains events for statements that potentially could have made changes (for example, a DELETE which matched no rows). The binary log also contains information about how long each statement took that updated data. The binary log has two important purposes:

  • For replication, the binary log is used on master replication servers as a record of the statements to be sent to slave servers. The master server sends the events contained in its binary log to its slaves, which execute those events to make the same data changes that were made on the master.
  • Certain data recovery operations require use of the binary log. After a backup has been restored, the events in the binary log that were recorded after the backup was made are re-executed. These events bring databases up to date from the point of the backup.

Step:1 Stop the mysql service using below command
# service mysqld stop
Step:2 Edit the mysql configuration files (/etc/my.cnf) and add below lines
log-bin = /var/lib/mysql/<application-name>-mysql-bin.log
OR
log-bin=mysql-bin
expire_logs_days = 2
# binary logging format – mixed recommended
binlog_format=mixed
The logs will go to the mysql data directory and will have the mysql-bin prefix if we use “log-bin=mysql-bin” otherwise we can mentioned the location as we have done in above file.
“expire_logs_days” system variable to expire binary log files automatically after a given number of days.
Step:3 Now start the mysql service using below command
# service mysqld start

Comments

Popular posts from this blog

Configure NTP (Network Time Protocol) on Windows Server 2008

The Network Time Protocol ( NTP ) in Windows 2008 provides your server with the ability to control the system clocks on your Windows client machines. This keeps all machines on the network synchronized with the same system time. This is beneficial for Windows administrators who need to schedule time-sensitive services on the network. You set the Windows 2008 NTP service in the registry. Step 1- Click the Windows 2008 “ Start ” button and enter “ regedit ” into the search box. Press Enter to open the Windows registry editor. Step 2- Navigate to the “ HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\ Services\W32Time\Config\ “. registry key Step 3- Double click the key value labeled “ AnnounceFlags ” in the center detail pane. Step 4- Enter “ A ” into the DWORD value text box. Click “ OK ” to save your settings. Close the Windows registry editor. Step 5- Click the Windows “ Start ” button and enter “ cmd ” into the text box. Press Enter to open the command prompt. Enter...

TI-RTOS Real Time Operating System for Microcontrollers

TI has released TI-RTOS , a real-time operating system (RTOS) for its microcontroller platform. This new RTOS helps developers by eliminating the need to write complex system software, such as file system, schedulers, drivers, and protocol stacks. TI-RTOS is provided with full C source code and requires no upfront or run-time license fees. TI-RTOS is based on existing components such as SYS/BIOS RTOS, controlSUITE, and StellarisWare software. The modular and scalable architecture enables system designers to chose sufficient modules/ functions and memory size as required. TI-RTOS Real Time Operating System for Microcontrollers Advertisement TI-RTOS is integrated into the TI’s CCStudio (Code Composer) IDE, which includes System Analyzer tools, enabling designers to view run-time application behavior including the sequence of thread execution and processor load. CCStudio IDE also has tools to assist multitasking debug. Designers  can use an object viewer (ROV...