SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Addict sstaubin01's Avatar
    Join Date
    Nov 2000
    Location
    Ont, Canada
    Posts
    234
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm having trouble creating MySql Update Logs. I use MySql for development using Win 98. I'm using user 'root' and MySql is set up to launch the MySql server at startup. I have created a my.cnf file in C:\mysql\data containing:
    [mysqld]
    log-update=c:\mysql\bin\update

    I expected to see update.100 after I shut down and started up the MySql server but it's not there.

    Can someone direct me to my mistake.

  2. #2
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi, Brian!

    Sorry for not answering this sooner. Indeed, the Windows version of MySQL expects the my.cnf to be in a different location than the Unix version. In Windows 98, you need to place my.cnf in C:\ (the root of C: drive). The following file should work:

    Code:
    [mysqld]
    # where you've installed MySQL
    basedir = d:/Progra~1/mysql/
    # where you want update logs kept
    log-update = d:/Progra~1/mysql/logs/update
    Let me know if you have any further trouble!
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  3. #3
    SitePoint Addict sstaubin01's Avatar
    Join Date
    Nov 2000
    Location
    Ont, Canada
    Posts
    234
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Kevin. Now I'm having problems applying the Update Logs. I create the logs in c:\mysql\logs and this is what is in update.001

    # c:/mysql/bin/mysqld-opt.exe, Version: 3.23.21-beta-log at 010206 23:46:52

    Notice the #. I move update.001 to c:\mysql\bin and ran this in DOS

    C:\mysql\bin>mysql -u root -ppassword --one-database dbname < update.001

    Changes made to the table after I restored the database from the backup and before update.001 was created were not applied to the table.

    Any ideas what's wrong?

  4. #4
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Was that the full content of the update log file? If so, the INSERT/UPDATE/etc. commands are not being logged in the update log file. The update logs should contain a record of all commands executed in the database that affect stored data.

    I just tried it here on my Windows server and it seemed to work fine. With update logging enabled I started MySQL server, logged in with the 'mysql' program and issued a DELETE command on a table. After exiting 'mysql', I viewed the update.001 that had been created, and it contained the commented line you quoted (beginning with a #) followed by a 'USE dbName;' command (where dbName was the name of the database that I was working with) and the DELETE command that I issued.

    Can you go through similar steps on your system to see if the command gets logged?
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  5. #5
    SitePoint Addict sstaubin01's Avatar
    Join Date
    Nov 2000
    Location
    Ont, Canada
    Posts
    234
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Kevin: I'm not able to test this now as my system is being upgraded (new hard drive, more memory). I'll test it again when I get back up and running then post my results. Thanks.

  6. #6
    SitePoint Addict sstaubin01's Avatar
    Join Date
    Nov 2000
    Location
    Ont, Canada
    Posts
    234
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Kevin: It's only been 13 days since we last talked about this problem. I'm speedy eh!

    Anyway, I have tried the sequence of events you described and I only get the commented line. Your last post states "With update logging enabled". What did you mean by this? Maybe this is what I'm missing.

    Have you any ideas why insert/update/delete commands are not being logged in the update log file?

  7. #7
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    'with update logging enabled' meaning with the log-update option in my my.cnf file.

    Hmm... I really don't know why you're not seeing your queries logged.

    If you delete the update logs and start your MySQL server again, does it recreate the update.001 file? I can't understand why your server would be creating the log file but not writing anything into it...
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  8. #8
    SitePoint Addict sstaubin01's Avatar
    Join Date
    Nov 2000
    Location
    Ont, Canada
    Posts
    234
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Kevin: I am now getting updates written to the log files. I didn't change anything. I don't know why the scenarios I mentioned before didn't work. I'll keep working with it to determine my problem. Thanks for your help.

  9. #9
    SitePoint Addict sstaubin01's Avatar
    Join Date
    Nov 2000
    Location
    Ont, Canada
    Posts
    234
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here's the reason. I was under the assumption that an update log was created when you stop the server and contained all activity while the server was active. In fact, the update log is created when the server is started and is written to while the server is active. You can't edit or delete the active log. When you shut down the server you can do what you want with the log file. When the server starts again a new log is created and will again be written to while the server is active. I had the sequence of events backwards.

    Thanks again Kevin for your help. I know your busy but you faithfully responded. Great support!

  10. #10
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Great support!
    ...in sharp contrast to a company that I'll be ranting about in today's issue of the Tech Times.
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •