bradcathey has asked for the wisdom of the Perl Monks concerning the following question:

• Successfully re-installed MySQL, DBI, DBD::mysql on my Powerbook
• created a database "highgate"
• copied in existing table files "addressbook"

Am able to SELECT, but getting a "table * is read only" error when I try to INSERT from my Perl script. I chmod'ed the database directory and tables to 750 and 660 respectively. I GRANTed liberally, and still problems. The test database works fine!

Note: MySQL resides in /usr/local/mysql/, so nothing unusual there. Here's a ls -l of the directories:
/data/ drwxr-x--- 5 mysql wheel 170 24 Nov 08:15 highgate drwxr-x--- 20 mysql wheel 680 17 Oct 01:12 mysql drwxr-x--- 5 mysql wheel 170 25 Nov 16:54 test /highgate/ -rw-rw---- 1 root wheel 23708 24 Nov 08:15 addressbook.MYD -rw-rw---- 1 root wheel 2048 24 Nov 08:15 addressbook.MYI -rw-rw---- 1 root wheel 8992 24 Nov 08:15 addressbook.frm
I've tried everything I can think of. Ideas? Thanks.

—Brad
"A little yeast leavens the whole dough."

Replies are listed 'Best First'.
Re: Read only error when writing to db (OT?)
by mpeppler (Vicar) on Nov 26, 2003 at 21:32 UTC
    Shouldbn't the addressbook files be owned by "mysql" rather than "root"?

    Michael

      mpeppler thanks, I thought that would do it, but after chown'ing, no dice.

      —Brad
      "A little yeast leavens the whole dough."
Re: Read only error when writing to db (OT?)
by barrd (Canon) on Nov 27, 2003 at 10:40 UTC
    Hi bradcathey,
    ...I GRANTed liberally, and still problems...

    After doing the grant privileges, you did remember to flush didn't you?

    mysql> FLUSH PRIVILEGES;

    Otherwise it will not work! ;)

    Update: Added link to MySQL flush command syntax (www.mysql.com)

      Thanks for the reply barrd, but I did remember to flush (I can't believe I just said that :-) and still....Maybe I need to reboot?

      —Brad
      "A little yeast leavens the whole dough."
        That was it! Rebooting did it. MySQL had to be restarted for some reason. Thanks all, and sorry for the obvious oversight. (forgot my three rules of computing: 1) reboot the printer. 2) reboot the machine, 3) RTFM)

        —Brad
        "A little yeast leavens the whole dough."