Re: [PHP] Database Duplication

2002-04-30 Thread Liam Gibbs

Maybe I should explain myself a little better. Sorry
for leaving out what turned out to be crucial details.

What is happening is I want to make a test user so
that, whenever I log in with that user, I can muck up
the database and not worry about what others will see
or permanent changes.

In the past, whenever I tested the site, I had to
quickly reset any changes I'd done to the database,
which sometimes involved an hour or more of work for
hidden bugs that I ended up overlooking.

The test user (whom only I know of) is needed to test
the Web site (make sure things are being deleted as
needed, etc.). What I envisioned is that, when I log
in as 'testuser', the database will be duplicated and
I'll use that. While I'm testing my site, mucking
things up, screwing up the data, I don't have to worry
about other users coming along and seeing these
changes, because they'll be seeing the original, ,
unscrewed data (which is why I need to use a muckable,
duplicate database), making changes, etc. This way,
that hour of work I mentioned would be eliminated.

When I log out, the database is useless because it's
only really test data (with enough real-life data
already populated in the database), and so it doesn't
matter what changes users have done in the meantime.

What I may do is just duplicate the database and have
a permanent, screwable database to play with, because
that seems like less of a load on the system. I just
wanted to have up-to-date data in my screwable
database. The above method looks like a lot of
processor time, etc., so just making a permanent test
data database may be the best option, so it doesn't
have to keep recopying. I just thought I'd throw out
the question and see if it was smaller than I thought
it would be.


__
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Database Duplication

2002-04-30 Thread Jason Wong

On Tuesday 30 April 2002 21:57, Liam Gibbs wrote:
 Maybe I should explain myself a little better. Sorry
 for leaving out what turned out to be crucial details.

I think someone asked in response to your original post what db are you 
using?. You still haven't told us!

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
The kind of danger people most enjoy is the kind they can watch from
a safe place.
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Database Duplication

2002-04-30 Thread Richard Emery

I'm going to guess you are using mysql.

Before starting a test, dump your database with the mysqldump command.
Edit this file to create/use your test database.
Load your test database with this file.

This is too obvious and too easy...therefore, I assume you already did this
and it did not provide what you needed.
What additional functionality are you seeking?
- Original Message -
From: Liam Gibbs [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, April 30, 2002 8:57 AM
Subject: Re: [PHP] Database Duplication


Maybe I should explain myself a little better. Sorry
for leaving out what turned out to be crucial details.

What is happening is I want to make a test user so
that, whenever I log in with that user, I can muck up
the database and not worry about what others will see
or permanent changes.

In the past, whenever I tested the site, I had to
quickly reset any changes I'd done to the database,
which sometimes involved an hour or more of work for
hidden bugs that I ended up overlooking.

The test user (whom only I know of) is needed to test
the Web site (make sure things are being deleted as
needed, etc.). What I envisioned is that, when I log
in as 'testuser', the database will be duplicated and
I'll use that. While I'm testing my site, mucking
things up, screwing up the data, I don't have to worry
about other users coming along and seeing these
changes, because they'll be seeing the original, ,
unscrewed data (which is why I need to use a muckable,
duplicate database), making changes, etc. This way,
that hour of work I mentioned would be eliminated.

When I log out, the database is useless because it's
only really test data (with enough real-life data
already populated in the database), and so it doesn't
matter what changes users have done in the meantime.

What I may do is just duplicate the database and have
a permanent, screwable database to play with, because
that seems like less of a load on the system. I just
wanted to have up-to-date data in my screwable
database. The above method looks like a lot of
processor time, etc., so just making a permanent test
data database may be the best option, so it doesn't
have to keep recopying. I just thought I'd throw out
the question and see if it was smaller than I thought
it would be.


__
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Database Duplication

2002-04-30 Thread Liam Gibbs

 I'm going to guess you are using mysql.

Dagwood. I always leave details out. Doesn't matter
what it is. Yes, it's MySQL, and I'm forwarding this
to the list because you're not the only one that
caught my oversight. Sorry about that again.

 Before starting a test, dump your database with the
 mysqldump command.
 Edit this file to create/use your test database.
 Load your test database with this file.

Hmm. No I didn't do this. Not too familiar with all
the intricacies of MySQL (or SQL). I'll take a look at
dumping the database.

 This is too obvious and too easy...therefore, I
 assume you already did this
 and it did not provide what you needed.
 What additional functionality are you seeking?

I'm just seeking a database duplication that I can
throw away after I'm done.


__
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Database Duplication

2002-04-30 Thread Miguel Cruz

On Tue, 30 Apr 2002, Liam Gibbs wrote:
 Before starting a test, dump your database with the
 mysqldump command.
 Edit this file to create/use your test database.
 Load your test database with this file.
 
 Hmm. No I didn't do this. Not too familiar with all
 the intricacies of MySQL (or SQL). I'll take a look at
 dumping the database.

Something like:

   mysqladmin -u root create temp_db
   mysql -u root -e 'grant all access on temp_db to real_user'
   mysqldump -u real_user real_db | mysql -u real_user temp_db

and then when you're done:

   mysqladmin -u root drop temp_db

obviously adding -p to those lines as appropriate.

But it's not going to be that fast with large databases, and you'll have 
to work out some scheme for dealing with multiple users each needing their 
own copy.

We don't know nearly enough about your project to really work out 
alternatives for you, but I bet there's a good one somewhere. Temp tables, 
shadow tables in the same database, something.

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Database Duplication

2002-04-29 Thread Liam Gibbs

I'm not sure if this is possible in PHP (maybe it's
even an SQL problem, I dunno), but is there a command
that will duplicate a database? I need to make a
'mirror' of it that I can dispose of after my user
logs out that won't change the source database at all.

__
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Database Duplication

2002-04-29 Thread Miguel Cruz

On Mon, 29 Apr 2002, Liam Gibbs wrote:
 I'm not sure if this is possible in PHP (maybe it's even an SQL problem,
 I dunno), but is there a command that will duplicate a database? I need
 to make a 'mirror' of it that I can dispose of after my user logs out
 that won't change the source database at all.

Normally you'd use the database's rollback mechanism for this.

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Database Duplication

2002-04-29 Thread Richard Emery

Every time a user logs in, you want to duplicate the database  Must be a
very small database...not one with several hundred-thousand records.

It's a SQL question.  You didn't specify what database you are using, so
nobody can provide you with specifics.
- Original Message -
From: Liam Gibbs [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, April 29, 2002 3:21 PM
Subject: [PHP] Database Duplication


I'm not sure if this is possible in PHP (maybe it's
even an SQL problem, I dunno), but is there a command
that will duplicate a database? I need to make a
'mirror' of it that I can dispose of after my user
logs out that won't change the source database at all.

__
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php