List Info

Thread: Re: database issues




Re: database issues
country flaguser name
United States
2007-08-29 20:44:48
Karl Latiss wrote:
> On Tue, 2007-08-28 at 18:29 -0700, Kurt Buff wrote:
> > Karl Latiss wrote:
> > > On Tue, 2007-08-28 at 09:51 -0700, Kurt Buff
wrote:
> > > > I have Maia running with postfix, etc.,
on a 68gb 
> > > partition. I had the system keeping 30 days
of quarantine, 
> > > but have just today lowered that down to 25
days, and am 
> > > currently running
'expire-quarantine-cache.pl', as disk space 
> > > is almost full - about 3gb free at the
moment. I'll be 
> > > backing it down in 5 day increments to get
quarantine down to 
> > > 15 days, in the hopes of freeing disk space.
> > > > 
> > > > I'm wondering, though, if something is
amiss with the MySQL 
> > > installation on this box, as there are
database files in 
> > > /var/db/mysql that have date stamps well
older than 30 days, 
> > > totalling around 26gbytes.
> > > > 
> > > Presuming InnoDB the only way to reduce the
datafile size is 
> > > to dump and
> > > restore. InnoDB data files do not
automatically reduce in 
> > > size when data
> > > is deleted.
> > > 
> > > -- 
> > > Karl Latiss <karl.latissatvert.com.au>
> > > Atvert Systems
> > 
> > I kind of suspected that, and yes, they are
InnoDB. I've 
> found a 70gb USB2 drive that I can attach, and use as 
> scratch, so this is looking like soonish kind of thing,

> unless my deletion of older quarantine items has
helped. I'll 
> know more about that tomorrow, but I've been monitoring
disk 
> space, and it's still dwindling - I'm down to 2.5gbytes
free 
> as of this writing, down from 2.9gbytes when I asked
the question.
> > 
> > I think I'll start looking at how to do this - any

> suggested URLs, in case my google-fu is weak?
> > 
> I just dump and restore:
> 
> mysqldump -Q --add-drop-table -u <username> -p -h
<hostname> 
> <dbname> >
> dbname.sql
> drop database <dbname>
> create database <dbname>
> mysql -u <username> -p -h <hostname>
<dbname> < dbname.sql
> 
> This assumes InnoDB is your default table type.
> 
> The drop removes the datafiles and create then creates
them. Keep in
> mind that if you have other InnoDB based databases
using this 
> same mysql
> server then the data files will not be removed and so
no space will be
> saved. If you do share the database server it's
probably worth looking
> at using the innodb_file_per_table setting.
> 
> Karl.

Well, I hope you have a word of advice here. I've done:

----------
     mysqldump -Q --add-drop-table -u root -p maia
/mnt/dump/maia.sql
     mysql -u root -p
          drop database maia;
          quit;
     /usr/local/etc/rc.d/mysql-server stop
-----------

After that, I took a look at /var/db/mysql, and still see 88
mysql-bin.* files in there with 57g worth of data. Should
that have disappeared? I assume I can't just nuke them,
because the other databases, namely information_schema,
cluster, mysql, and test - correct?

I then followed with 

----------
     /usr/local/etc/rc.d/mysql-server stop
     mysql -u root -p
----------

to start mysql back up again.

"Now what?", is my plaintive cry.

Kurt
_______________________________________________
Maia-users mailing list
Maia-usersrenaissoft.com
http://www.renaissoft.com/mailman/listinfo/maia-users

Re: database issues
country flaguser name
United States
2007-08-29 21:44:53
> Well, I hope you have a word of advice here. I've
done:
>
> ----------
>      mysqldump -Q --add-drop-table -u root -p maia
/mnt/dump/maia.sql
>      mysql -u root -p
>           drop database maia;
>           quit;
>      /usr/local/etc/rc.d/mysql-server stop
> -----------
>
> After that, I took a look at /var/db/mysql, and still
see 88 mysql-bin.*
> files in there with 57g worth of data. Should that have
disappeared? I
> assume I can't just nuke them, because the other
databases, namely
> information_schema, cluster, mysql, and test -
correct?
>
> I then followed with
>
> ----------
>      /usr/local/etc/rc.d/mysql-server stop
>      mysql -u root -p
> ----------
>
> to start mysql back up again.
>
> "Now what?", is my plaintive cry.
>
> Kurt

Kurt,

I'm 99% sure you can just delete the mysql-bin.* files if
you aren't doing
any database replication.  If I recall, I had the same
problem as you and
almost ran out of disk space before realizing those files
aren't even
really necessary.  In fact, you can also turn off binary
logging in my.cnf
so those files don't get created anymore.  Google mysql-bin
for more
details.

Regards,

Ryan

_______________________________________________
Maia-users mailing list
Maia-usersrenaissoft.com
http://www.renaissoft.com/mailman/listinfo/maia-users

Re: database issues
country flaguser name
Australia
2007-08-29 23:43:59
On Wed, 2007-08-29 at 19:44 -0700, Ryan Delany wrote:
> > Well, I hope you have a word of advice here. I've
done:
> >
> > ----------
> >      mysqldump -Q --add-drop-table -u root -p maia
/mnt/dump/maia.sql
> >      mysql -u root -p
> >           drop database maia;
> >           quit;
> >      /usr/local/etc/rc.d/mysql-server stop
> > -----------
> >
> > After that, I took a look at /var/db/mysql, and
still see 88 mysql-bin.*
> > files in there with 57g worth of data. Should that
have disappeared? I
> > assume I can't just nuke them, because the other
databases, namely
> > information_schema, cluster, mysql, and test -
correct?
> >
> > I then followed with
> >
> > ----------
> >      /usr/local/etc/rc.d/mysql-server stop
> >      mysql -u root -p
> > ----------
> >
> > to start mysql back up again.
> >
> > "Now what?", is my plaintive cry.
> >
> > Kurt
> 
> Kurt,
> 
> I'm 99% sure you can just delete the mysql-bin.* files
if you aren't doing
> any database replication.  If I recall, I had the same
problem as you and
> almost ran out of disk space before realizing those
files aren't even
> really necessary.  In fact, you can also turn off
binary logging in my.cnf
> so those files don't get created anymore.  Google
mysql-bin for more
> details.
> 
> Regards,
> 
> Ryan

That's correct - if you're not replicating to another MySQL
database
server then you can disable the binary file creation by
making sure you
don't have a log-bin entry in my.cnf. If you don't replicate
you can
stop the database server, remove the binary log files,
remove log-bin
setting and re-start the database server.

Also, assuming you don't have innodb_file_per_table set all
your
databases will live in one file (something like ibdata1).
That's the
file you probably don't want to delete at this stage.

Karl.

_______________________________________________
Maia-users mailing list
Maia-usersrenaissoft.com
http://www.renaissoft.com/mailman/listinfo/maia-users

Re: database issues
country flaguser name
United States
2007-08-30 00:19:23
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On Aug 29, 2007, at 11:43 PM, Karl Latiss wrote:

> On Wed, 2007-08-29 at 19:44 -0700, Ryan Delany wrote:
>>> information_schema, cluster, mysql, and test -
correct?Also,  
>>> assuming you don't have innodb_file_per_table
set all your
>

> databases will live in one file (something like
ibdata1). That's the
> file you probably don't want to delete at this stage.


Those tables are usually myisam or special... not innodb. 
If you  
haven't created any other databases, then it may be that
maia is the  
only database namespace using ibdata1.   Check the types of
all  
database tables, and if there aren't any other innodb
tables, I think  
it is safe to remove the ibdata1 file as well.

Is innodb_file_per_table the recommended way to do things
now?

David Morton
Maia Mailguard http://www.maiamailguard
.com
mortondadgrmm.net



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFG1lNeUy30ODPkzl0RAm2uAJ9dKRBBN7R5bg+h4M5CkKdv494IiQCa
A/i5
BmB9TOgFfnVPgjl5IZ+ZFUo=
=Ed78
-----END PGP SIGNATURE-----
_______________________________________________
Maia-users mailing list
Maia-usersrenaissoft.com
http://www.renaissoft.com/mailman/listinfo/maia-users

Re: database issues
country flaguser name
Australia
2007-08-30 20:05:56
On Thu, 2007-08-30 at 00:19 -0500, David Morton wrote:

> 
> Is innodb_file_per_table the recommended way to do
things now?
> 
I don't think there's a recommendation one way or the other.
We use a
shared database server so it makes sense for us. When there
are a lot of
database additions and removals we don't have to worry about
an ever
growing communal file (or files). YMMV.

-- 
Karl Latiss <karl.latissatvert.com.au>
Atvert Systems

_______________________________________________
Maia-users mailing list
Maia-usersrenaissoft.com
http://www.renaissoft.com/mailman/listinfo/maia-users

[1-5]

about | contact  Other archives ( Real Estate discussion Medical topics )