If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Binary Log per Database

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-16-08, 02:58
gwgeller gwgeller is offline
Registered User
 
Join Date: Jan 2004
Posts: 145
Binary Log per Database

Hello,
Is it possible to have a separate binary log per database? We have two production db's on the same server and the current binary log gets to be about a gig every few days.
__________________
GG
Code:
On Error Goto Hell

Hell:
    Msgbox("An error occurred, but was sent to Hell. You may continue.")
Reply With Quote
  #2 (permalink)  
Old 12-29-08, 16:17
gwgeller gwgeller is offline
Registered User
 
Join Date: Jan 2004
Posts: 145
Hello, just revisiting this. SQL Server handles each transaction log separately per database. The binary log seems to be MySql's version of the transaction log, but I haven't found a way to generate a separate log per database.
__________________
GG
Code:
On Error Goto Hell

Hell:
    Msgbox("An error occurred, but was sent to Hell. You may continue.")
Reply With Quote
  #3 (permalink)  
Old 01-12-09, 12:43
gwgeller gwgeller is offline
Registered User
 
Join Date: Jan 2004
Posts: 145
I've found a solution, but it's not as easy as SQL Server. That being said it will have it's advantages. Anyway what I'm going to do is create separate mysql instances using mysqld_multi. This will allow me to specify different data and logging directories and files per instance. Basically each instance has it's own section in the my.cnf file where you can specify any option you like. In addition you can specify global options that all instances will use.
__________________
GG
Code:
On Error Goto Hell

Hell:
    Msgbox("An error occurred, but was sent to Hell. You may continue.")
Reply With Quote
  #4 (permalink)  
Old 01-16-09, 15:26
alexsqlforums alexsqlforums is offline
Registered User
 
Join Date: Jan 2009
Location: NYC
Posts: 11
what are you trying to do?
mysqlbinlog command offers the --database option to filter the binlog to show entries for that database.

http://dev.mysql.com/doc/refman/5.0/en/mysqlbinlog.html
Reply With Quote
  #5 (permalink)  
Old 01-16-09, 17:00
gwgeller gwgeller is offline
Registered User
 
Join Date: Jan 2004
Posts: 145
Alex,
Currently we have two websites using the same MySql server, separate DB's, as a backend. I couldn't find a way, other than what I previously suggested, to have a separate binlog for each database on that server. As far as I can tell both are forced to use the same binlog. My initial goal was to have a seperate physical binlog file for each database.

I'm curious if you have an answer but I'll probably go with my solution because it offers other benefits like separate logging/data directories and files, separate user accounts, etc and the ability to start and stop without disrupting other websites. It will be easier to analyze the logs since I won't have to determine which db is creating the activity.
__________________
GG
Code:
On Error Goto Hell

Hell:
    Msgbox("An error occurred, but was sent to Hell. You may continue.")
Reply With Quote
  #6 (permalink)  
Old 01-16-09, 22:30
alexsqlforums alexsqlforums is offline
Registered User
 
Join Date: Jan 2009
Location: NYC
Posts: 11
Whatever floats your boat as long as it's not on windows.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On