Problem w/ mysqldump

Problem w/ mysqldump

am 02.09.2009 12:43:12 von Victor Subervi

--00148539266001f3d4047295efc2
Content-Type: text/plain; charset=ISO-8859-1

Hi:
I have the following python code:
import os
os.system("mysqldump -u root -pPASSWORD --opt spreadsheets > dump.sql")
This nicely creates the file...but the file is empty! The database exists
and has lots of data, I double-checked it. If there is nothing wrong with my
code, is there some way to do the same thing from within MySQL? Can I at
least print everything to screen and copy it? Where would I find my database
in Windoze?
TIA,
Victor

--00148539266001f3d4047295efc2--

Re: Problem w/ mysqldump

am 02.09.2009 16:18:28 von Emile van Sebille

On 9/2/2009 3:43 AM Victor Subervi said...
> Hi:
> I have the following python code:
> import os
> os.system("mysqldump -u root -pPASSWORD --opt spreadsheets > dump.sql")

First, test this at the system command line -- you'll likely get an
empty file there as well, so calling from within python simply does the
same.

Then read the mysqldump docs for the command arguments and supply the
database name...

Emile


> This nicely creates the file...but the file is empty! The database exists
> and has lots of data, I double-checked it. If there is nothing wrong with my
> code, is there some way to do the same thing from within MySQL? Can I at
> least print everything to screen and copy it? Where would I find my database
> in Windoze?
> TIA,
> Victor
>

--
http://mail.python.org/mailman/listinfo/python-list

RE: Problem w/ mysqldump

am 02.09.2009 22:09:52 von Daevid Vincent

While not python, maybe this bash script will give you some clues?
http://daevid.com/content/examples/daily_backup.php

Also, please don't cross post to multiple lists. Not everyone on this mySQL
list is on the python list and vice versa. It's just bad netiquette.

> -----Original Message-----
> From: news [mailto:news@ger.gmane.org] On Behalf Of Emile van Sebille
> Sent: Wednesday, September 02, 2009 7:18 AM
> To: mysql@lists.mysql.com
> Cc: python-list@python.org
> Subject: Re: Problem w/ mysqldump
>
> On 9/2/2009 3:43 AM Victor Subervi said...
> > Hi:
> > I have the following python code:
> > import os
> > os.system("mysqldump -u root -pPASSWORD --opt spreadsheets
> > dump.sql")
>
> First, test this at the system command line -- you'll likely get an
> empty file there as well, so calling from within python
> simply does the
> same.
>
> Then read the mysqldump docs for the command arguments and supply the
> database name...
>
> Emile
>
>
> > This nicely creates the file...but the file is empty! The
> database exists
> > and has lots of data, I double-checked it. If there is
> nothing wrong with my
> > code, is there some way to do the same thing from within
> MySQL? Can I at
> > least print everything to screen and copy it? Where would I
> find my database
> > in Windoze?
> > TIA,
> > Victor
> >
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/mysql?unsub=daevid@daevid.com
>


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

Re: Problem w/ mysqldump

am 02.09.2009 22:43:29 von Victor Subervi

--0016364ee872c4bafc04729e5185
Content-Type: text/plain; charset=ISO-8859-1

I checked my own backup script from earlier years and everything was good.
You know, if I could simply figure out where the data was actually stored,
in what file, I could copy it over to another computer. Any ideas?
Thanks,
V

On Wed, Sep 2, 2009 at 4:09 PM, Daevid Vincent wrote:

> While not python, maybe this bash script will give you some clues?
> http://daevid.com/content/examples/daily_backup.php
>
> Also, please don't cross post to multiple lists. Not everyone on this mySQL
> list is on the python list and vice versa. It's just bad netiquette.
>
> > -----Original Message-----
> > From: news [mailto:news@ger.gmane.org] On Behalf Of Emile van Sebille
> > Sent: Wednesday, September 02, 2009 7:18 AM
> > To: mysql@lists.mysql.com
> > Cc: python-list@python.org
> > Subject: Re: Problem w/ mysqldump
> >
> > On 9/2/2009 3:43 AM Victor Subervi said...
> > > Hi:
> > > I have the following python code:
> > > import os
> > > os.system("mysqldump -u root -pPASSWORD --opt spreadsheets
> > > dump.sql")
> >
> > First, test this at the system command line -- you'll likely get an
> > empty file there as well, so calling from within python
> > simply does the
> > same.
> >
> > Then read the mysqldump docs for the command arguments and supply the
> > database name...
> >
> > Emile
> >
> >
> > > This nicely creates the file...but the file is empty! The
> > database exists
> > > and has lots of data, I double-checked it. If there is
> > nothing wrong with my
> > > code, is there some way to do the same thing from within
> > MySQL? Can I at
> > > least print everything to screen and copy it? Where would I
> > find my database
> > > in Windoze?
> > > TIA,
> > > Victor
> > >
> >
> >
> > --
> > MySQL General Mailing List
> > For list archives: http://lists.mysql.com/mysql
> > To unsubscribe:
> > http://lists.mysql.com/mysql?unsub=daevid@daevid.com
> >
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/mysql?unsub=victorsubervi@gmail.com
>
>

--0016364ee872c4bafc04729e5185--

RE: Problem w/ mysqldump

am 02.09.2009 23:29:03 von Daevid Vincent

If it's MYISAM tables, then they're all self contained in folders in
/var/lib/mysql/spreadsheets. Remember that if you do copy the files, to shut
down mysql first or you could copy corrupt files.

If you're using INNODB, then the schema is in that folder, but the actual
data is in the /var/lib/mysql/ib* files. Along with all the other INNODB
databases you may have on the system -- all mashed together. Hence the need
for a mysql dump tool ;-)

Mysql dump is the better way to go in either situation.

> -----Original Message-----
> From: Victor Subervi [mailto:victorsubervi@gmail.com]
> Sent: Wednesday, September 02, 2009 1:43 PM
> To: Daevid Vincent; mysql@lists.mysql.com
> Subject: Re: Problem w/ mysqldump
>
> I checked my own backup script from earlier years and
> everything was good.
> You know, if I could simply figure out where the data was
> actually stored,
> in what file, I could copy it over to another computer. Any ideas?
> Thanks,
> V
>
> On Wed, Sep 2, 2009 at 4:09 PM, Daevid Vincent
> wrote:
>
> > While not python, maybe this bash script will give you some clues?
> > http://daevid.com/content/examples/daily_backup.php
> >
> > Also, please don't cross post to multiple lists. Not
> everyone on this mySQL
> > list is on the python list and vice versa. It's just bad netiquette.
> >
> > > -----Original Message-----
> > > From: news [mailto:news@ger.gmane.org] On Behalf Of Emile
> van Sebille
> > > Sent: Wednesday, September 02, 2009 7:18 AM
> > > To: mysql@lists.mysql.com
> > > Cc: python-list@python.org
> > > Subject: Re: Problem w/ mysqldump
> > >
> > > On 9/2/2009 3:43 AM Victor Subervi said...
> > > > Hi:
> > > > I have the following python code:
> > > > import os
> > > > os.system("mysqldump -u root -pPASSWORD --opt spreadsheets
> > > > dump.sql")
> > >
> > > First, test this at the system command line -- you'll
> likely get an
> > > empty file there as well, so calling from within python
> > > simply does the
> > > same.
> > >
> > > Then read the mysqldump docs for the command arguments
> and supply the
> > > database name...
> > >
> > > Emile
> > >
> > >
> > > > This nicely creates the file...but the file is empty! The
> > > database exists
> > > > and has lots of data, I double-checked it. If there is
> > > nothing wrong with my
> > > > code, is there some way to do the same thing from within
> > > MySQL? Can I at
> > > > least print everything to screen and copy it? Where would I
> > > find my database
> > > > in Windoze?
> > > > TIA,
> > > > Victor
> > > >
> > >
> > >
> > > --
> > > MySQL General Mailing List
> > > For list archives: http://lists.mysql.com/mysql
> > > To unsubscribe:
> > > http://lists.mysql.com/mysql?unsub=daevid@daevid.com
> > >
> >
> >
> > --
> > MySQL General Mailing List
> > For list archives: http://lists.mysql.com/mysql
> > To unsubscribe:
> > http://lists.mysql.com/mysql?unsub=victorsubervi@gmail.com
> >
> >
>


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

Re: Problem w/ mysqldump

am 02.09.2009 23:49:59 von Victor Subervi

--000e0cd6aa629a497904729f3f6b
Content-Type: text/plain; charset=ISO-8859-1

Not in Windoze. The only folders I have inside the Programs/MySQL are Docs,
bin and Shared
V

On Wed, Sep 2, 2009 at 5:29 PM, Daevid Vincent wrote:

> If it's MYISAM tables, then they're all self contained in folders in
> /var/lib/mysql/spreadsheets. Remember that if you do copy the files, to
> shut
> down mysql first or you could copy corrupt files.
>
> If you're using INNODB, then the schema is in that folder, but the actual
> data is in the /var/lib/mysql/ib* files. Along with all the other INNODB
> databases you may have on the system -- all mashed together. Hence the need
> for a mysql dump tool ;-)
>
> Mysql dump is the better way to go in either situation.
>
> > -----Original Message-----
> > From: Victor Subervi [mailto:victorsubervi@gmail.com]
> > Sent: Wednesday, September 02, 2009 1:43 PM
> > To: Daevid Vincent; mysql@lists.mysql.com
> > Subject: Re: Problem w/ mysqldump
> >
> > I checked my own backup script from earlier years and
> > everything was good.
> > You know, if I could simply figure out where the data was
> > actually stored,
> > in what file, I could copy it over to another computer. Any ideas?
> > Thanks,
> > V
> >
> > On Wed, Sep 2, 2009 at 4:09 PM, Daevid Vincent
> > wrote:
> >
> > > While not python, maybe this bash script will give you some clues?
> > > http://daevid.com/content/examples/daily_backup.php
> > >
> > > Also, please don't cross post to multiple lists. Not
> > everyone on this mySQL
> > > list is on the python list and vice versa. It's just bad netiquette.
> > >
> > > > -----Original Message-----
> > > > From: news [mailto:news@ger.gmane.org] On Behalf Of Emile
> > van Sebille
> > > > Sent: Wednesday, September 02, 2009 7:18 AM
> > > > To: mysql@lists.mysql.com
> > > > Cc: python-list@python.org
> > > > Subject: Re: Problem w/ mysqldump
> > > >
> > > > On 9/2/2009 3:43 AM Victor Subervi said...
> > > > > Hi:
> > > > > I have the following python code:
> > > > > import os
> > > > > os.system("mysqldump -u root -pPASSWORD --opt spreadsheets
> > > > > dump.sql")
> > > >
> > > > First, test this at the system command line -- you'll
> > likely get an
> > > > empty file there as well, so calling from within python
> > > > simply does the
> > > > same.
> > > >
> > > > Then read the mysqldump docs for the command arguments
> > and supply the
> > > > database name...
> > > >
> > > > Emile
> > > >
> > > >
> > > > > This nicely creates the file...but the file is empty! The
> > > > database exists
> > > > > and has lots of data, I double-checked it. If there is
> > > > nothing wrong with my
> > > > > code, is there some way to do the same thing from within
> > > > MySQL? Can I at
> > > > > least print everything to screen and copy it? Where would I
> > > > find my database
> > > > > in Windoze?
> > > > > TIA,
> > > > > Victor
> > > > >
> > > >
> > > >
> > > > --
> > > > MySQL General Mailing List
> > > > For list archives: http://lists.mysql.com/mysql
> > > > To unsubscribe:
> > > > http://lists.mysql.com/mysql?unsub=daevid@daevid.com
> > > >
> > >
> > >
> > > --
> > > MySQL General Mailing List
> > > For list archives: http://lists.mysql.com/mysql
> > > To unsubscribe:
> > > http://lists.mysql.com/mysql?unsub=victorsubervi@gmail.com
> > >
> > >
> >
>
>

--000e0cd6aa629a497904729f3f6b--