Read only error

Read only error

am 28.02.2005 16:20:13 von Giff Hammar

I know this should be easy, but I'm stumped.

I inherited a system that uses perl and mysql to read in a set of e-mails and
process them. The system is running on Debian and was copied from a different
Debian system. When I try to run the perl script to import an e-mail, I get

DBD::mysql::db do failed: Table 'table_name' is read only at ./parts.pl line
435.
DBD::mysql::db do failed: Table 'table_name' is read only at /home/inv/sparts.pm
line 140.
Can't lock tables: Table 'table_name' is read only

I get the same error when I run the script as root or the user 'inv'. So far, I
have:

1. Changed ownership of all of the database files to inv
2. Opened the database file permissions to 777
3. Changed the user table in mysql to allow inv full access to all privs
4. Changed the host table in mysql to allow the local host full access to the
database

What did I miss?

Giff

Giff Hammar ghammar@certifiedparts.com
IT Director
Certified Parts Warehouse
V: 603.772.8870 F: 603.778.6931
http://www.certifiedparts.com



--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

Re: Read only error

am 28.02.2005 16:30:49 von Peter Pentchev

--6c2NcOVqGQ03X4Wi
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Feb 28, 2005 at 10:20:13AM -0500, Giff Hammar wrote:
> I know this should be easy, but I'm stumped.
>=20
> I inherited a system that uses perl and mysql to read in a set of e-mails=
and
> process them. The system is running on Debian and was copied from a diffe=
rent
> Debian system. When I try to run the perl script to import an e-mail, I g=
et
>=20
> DBD::mysql::db do failed: Table 'table_name' is read only at ./parts.pl l=
ine
> 435.
> DBD::mysql::db do failed: Table 'table_name' is read only at /home/inv/sp=
arts.pm
> line 140.
> Can't lock tables: Table 'table_name' is read only
>=20
> I get the same error when I run the script as root or the user 'inv'. So =
far, I
> have:
>=20
> 1. Changed ownership of all of the database files to inv
> 2. Opened the database file permissions to 777
> 3. Changed the user table in mysql to allow inv full access to all privs
> 4. Changed the host table in mysql to allow the local host full access to=
the
> database
>=20
> What did I miss?

Is it possible that the table has been compressed using myisampack?

You can find out my running 'myisampack -t tablename' in the appropriate
database directory; if the table is already compressed, myisampack will
tell you so, otherwise it will output some statistics about the keys
distribution in the table.

If the table is compressed, you can use 'myisamchk --unpack tablename'
to unpack it - but make sure you do this while the MySQL server is NOT
running! After that, you might need to run myisamchk on the unpacked
table again, just in case.

G'luck,
Peter

--=20
Peter Pentchev roam@ringlet.net roam@cnsys.bg roam@FreeBSD.org
PGP key: http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553
I had to translate this sentence into English because I could not read the =
original Sanskrit.

--6c2NcOVqGQ03X4Wi
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (FreeBSD)

iD8DBQFCIzkp7Ri2jRYZRVMRAvvSAJwObn3tNrTrNYZ34RXgditSmQQ+lACc CtU5
/c5k+RBMNdGqlvRXrmTqSZA=
=aVgG
-----END PGP SIGNATURE-----

--6c2NcOVqGQ03X4Wi--

RE: Read only error

am 28.02.2005 18:04:04 von Giff Hammar

Peter,

The table was not compressed to begin with, but after I uncompressed it again,
it worked. Thanks for the pointer!

Giff

-----Original Message-----
From: Peter Pentchev [mailto:roam@ringlet.net]
Sent: Monday, 28 February, 2005 10:31
To: Giff Hammar
Cc: perl@lists.mysql.com
Subject: Re: Read only error

On Mon, Feb 28, 2005 at 10:20:13AM -0500, Giff Hammar wrote:
> I know this should be easy, but I'm stumped.
>
> I inherited a system that uses perl and mysql to read in a set of
> e-mails and process them. The system is running on Debian and was
> copied from a different Debian system. When I try to run the perl
> script to import an e-mail, I get
>
> DBD::mysql::db do failed: Table 'table_name' is read only at
> ./parts.pl line 435.
> DBD::mysql::db do failed: Table 'table_name' is read only at
> /home/inv/sparts.pm line 140.
> Can't lock tables: Table 'table_name' is read only
>
> I get the same error when I run the script as root or the user 'inv'.
> So far, I
> have:
>
> 1. Changed ownership of all of the database files to inv 2. Opened the
> database file permissions to 777 3. Changed the user table in mysql to
> allow inv full access to all privs 4. Changed the host table in mysql
> to allow the local host full access to the database
>
> What did I miss?

Is it possible that the table has been compressed using myisampack?

You can find out my running 'myisampack -t tablename' in the appropriate
database directory; if the table is already compressed, myisampack will tell you
so, otherwise it will output some statistics about the keys distribution in the
table.

If the table is compressed, you can use 'myisamchk --unpack tablename'
to unpack it - but make sure you do this while the MySQL server is NOT running!
After that, you might need to run myisamchk on the unpacked table again, just in
case.

G'luck,
Peter

--
Peter Pentchev roam@ringlet.net roam@cnsys.bg roam@FreeBSD.org
PGP key: http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553
I had to translate this sentence into English because I could not read the
original Sanskrit.


--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org