clone a database on the same machine
clone a database on the same machine
am 20.09.2010 11:30:41 von Uwe Brauer
Hello
I would like to clone a database db_org to db_clone on the same machine. Could
I use the dump command for this? Should the user of both db
be the same?
Something like
# mysqladmin create db_clone -u DB_user
mysqldump -p db_org > clone.sql
mysql -p -D db_clone < clone.sql
thanks
Uwe Brauer
--
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: clone a database on the same machine
am 20.09.2010 11:34:24 von Ananda Kumar
--00163645796228ebb30490ad9ee0
Content-Type: text/plain; charset=ISO-8859-1
The dump file has to be edited to replace old db name to the new db name.
regards
anandkl
On Mon, Sep 20, 2010 at 3:00 PM, Uwe Brauer wrote:
> Hello
>
> I would like to clone a database db_org to db_clone on the same machine.
> Could
> I use the dump command for this? Should the user of both db
> be the same?
> Something like
> # mysqladmin create db_clone -u DB_user
>
> mysqldump -p db_org > clone.sql
> mysql -p -D db_clone < clone.sql
>
>
> thanks
>
> Uwe Brauer
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/mysql?unsub=anandkl@gmail.com
>
>
--00163645796228ebb30490ad9ee0--
Re: clone a database on the same machine
am 20.09.2010 11:49:01 von Johan De Meersman
--0022152d5fb57adf180490add256
Content-Type: text/plain; charset=ISO-8859-1
Not the way he does it :-)
If you use "--databases", mysqldump will add "create database" and "use
database" statements. if you specify the db without that parameter, it
won't.
On Mon, Sep 20, 2010 at 11:34 AM, Ananda Kumar wrote:
> The dump file has to be edited to replace old db name to the new db name.
>
> regards
> anandkl
>
> On Mon, Sep 20, 2010 at 3:00 PM, Uwe Brauer wrote:
>
> > Hello
> >
> > I would like to clone a database db_org to db_clone on the same machine.
> > Could
> > I use the dump command for this? Should the user of both db
> > be the same?
> > Something like
> > # mysqladmin create db_clone -u DB_user
> >
> > mysqldump -p db_org > clone.sql
> > mysql -p -D db_clone < clone.sql
> >
> >
> > thanks
> >
> > Uwe Brauer
> >
> >
> > --
> > MySQL General Mailing List
> > For list archives: http://lists.mysql.com/mysql
> > To unsubscribe: http://lists.mysql.com/mysql?unsub=anandkl@gmail.com
> >
> >
>
--
Bier met grenadyn
Is als mosterd by den wyn
Sy die't drinkt, is eene kwezel
Hy die't drinkt, is ras een ezel
--0022152d5fb57adf180490add256--
Re: clone a database on the same machine
am 20.09.2010 11:58:01 von Ananda Kumar
--001636833d4aa681bd0490adf2e6
Content-Type: text/plain; charset=ISO-8859-1
With the method you mentioned, you need to have the new db name already
present.
You can do it this way or the edit dump file way.
regards
anandkl
On Mon, Sep 20, 2010 at 3:19 PM, Johan De Meersman wrote:
> Not the way he does it :-)
>
> If you use "--databases", mysqldump will add "create database" and "use
> database" statements. if you specify the db without that parameter, it
> won't.
>
>
> On Mon, Sep 20, 2010 at 11:34 AM, Ananda Kumar wrote:
>
>> The dump file has to be edited to replace old db name to the new db name.
>>
>> regards
>> anandkl
>>
>> On Mon, Sep 20, 2010 at 3:00 PM, Uwe Brauer wrote:
>>
>> > Hello
>> >
>> > I would like to clone a database db_org to db_clone on the same machine.
>> > Could
>> > I use the dump command for this? Should the user of both db
>> > be the same?
>> > Something like
>> > # mysqladmin create db_clone -u DB_user
>> >
>> > mysqldump -p db_org > clone.sql
>> > mysql -p -D db_clone < clone.sql
>> >
>> >
>> > thanks
>> >
>> > Uwe Brauer
>> >
>> >
>> > --
>> > MySQL General Mailing List
>> > For list archives: http://lists.mysql.com/mysql
>> > To unsubscribe: http://lists.mysql.com/mysql?unsub=anandkl@gmail.com
>> >
>> >
>>
>
>
>
> --
> Bier met grenadyn
> Is als mosterd by den wyn
> Sy die't drinkt, is eene kwezel
> Hy die't drinkt, is ras een ezel
>
--001636833d4aa681bd0490adf2e6--
Re: clone a database on the same machine
am 20.09.2010 12:14:06 von Johan De Meersman
--0050450156882e4d7a0490ae2cd3
Content-Type: text/plain; charset=ISO-8859-1
He did suggest doing mysqladmin create :-p
On Mon, Sep 20, 2010 at 11:58 AM, Ananda Kumar wrote:
> With the method you mentioned, you need to have the new db name already
> present.
> You can do it this way or the edit dump file way.
>
> regards
> anandkl
>
> On Mon, Sep 20, 2010 at 3:19 PM, Johan De Meersman wrote:
>
>> Not the way he does it :-)
>>
>> If you use "--databases", mysqldump will add "create database" and "use
>> database" statements. if you specify the db without that parameter, it
>> won't.
>>
>>
>> On Mon, Sep 20, 2010 at 11:34 AM, Ananda Kumar wrote:
>>
>>> The dump file has to be edited to replace old db name to the new db name.
>>>
>>> regards
>>> anandkl
>>>
>>> On Mon, Sep 20, 2010 at 3:00 PM, Uwe Brauer wrote:
>>>
>>> > Hello
>>> >
>>> > I would like to clone a database db_org to db_clone on the same
>>> machine.
>>> > Could
>>> > I use the dump command for this? Should the user of both db
>>> > be the same?
>>> > Something like
>>> > # mysqladmin create db_clone -u DB_user
>>> >
>>> > mysqldump -p db_org > clone.sql
>>> > mysql -p -D db_clone < clone.sql
>>> >
>>> >
>>> > thanks
>>> >
>>> > Uwe Brauer
>>> >
>>> >
>>> > --
>>> > MySQL General Mailing List
>>> > For list archives: http://lists.mysql.com/mysql
>>> > To unsubscribe:
>>> http://lists.mysql.com/mysql?unsub=anandkl@gmail.com
>>> >
>>> >
>>>
>>
>>
>>
>> --
>> Bier met grenadyn
>> Is als mosterd by den wyn
>> Sy die't drinkt, is eene kwezel
>> Hy die't drinkt, is ras een ezel
>>
>
>
--
Bier met grenadyn
Is als mosterd by den wyn
Sy die't drinkt, is eene kwezel
Hy die't drinkt, is ras een ezel
--0050450156882e4d7a0490ae2cd3--
Re: clone a database on the same machine
am 20.09.2010 12:36:18 von Ananda Kumar
--0016367fa92d8a9e440490ae7b90
Content-Type: text/plain; charset=ISO-8859-1
oopss...sorry...i did not see that line....
On Mon, Sep 20, 2010 at 3:44 PM, Johan De Meersman wrote:
> He did suggest doing mysqladmin create :-p
>
>
> On Mon, Sep 20, 2010 at 11:58 AM, Ananda Kumar wrote:
>
>> With the method you mentioned, you need to have the new db name already
>> present.
>> You can do it this way or the edit dump file way.
>>
>> regards
>> anandkl
>>
>> On Mon, Sep 20, 2010 at 3:19 PM, Johan De Meersman wrote:
>>
>>> Not the way he does it :-)
>>>
>>> If you use "--databases", mysqldump will add "create database" and "use
>>> database" statements. if you specify the db without that parameter, it
>>> won't.
>>>
>>>
>>> On Mon, Sep 20, 2010 at 11:34 AM, Ananda Kumar wrote:
>>>
>>>> The dump file has to be edited to replace old db name to the new db
>>>> name.
>>>>
>>>> regards
>>>> anandkl
>>>>
>>>> On Mon, Sep 20, 2010 at 3:00 PM, Uwe Brauer wrote:
>>>>
>>>> > Hello
>>>> >
>>>> > I would like to clone a database db_org to db_clone on the same
>>>> machine.
>>>> > Could
>>>> > I use the dump command for this? Should the user of both db
>>>> > be the same?
>>>> > Something like
>>>> > # mysqladmin create db_clone -u DB_user
>>>> >
>>>> > mysqldump -p db_org > clone.sql
>>>> > mysql -p -D db_clone < clone.sql
>>>> >
>>>> >
>>>> > thanks
>>>> >
>>>> > Uwe Brauer
>>>> >
>>>> >
>>>> > --
>>>> > MySQL General Mailing List
>>>> > For list archives: http://lists.mysql.com/mysql
>>>> > To unsubscribe:
>>>> http://lists.mysql.com/mysql?unsub=anandkl@gmail.com
>>>> >
>>>> >
>>>>
>>>
>>>
>>>
>>> --
>>> Bier met grenadyn
>>> Is als mosterd by den wyn
>>> Sy die't drinkt, is eene kwezel
>>> Hy die't drinkt, is ras een ezel
>>>
>>
>>
>
>
> --
> Bier met grenadyn
> Is als mosterd by den wyn
> Sy die't drinkt, is eene kwezel
> Hy die't drinkt, is ras een ezel
>
--0016367fa92d8a9e440490ae7b90--
Re: clone a database on the same machine
am 20.09.2010 12:48:21 von Uwe Brauer
>>>>> On Mon, 20 Sep 2010 12:14:06 +0200, Johan De Meersman wrote:
> He did suggest doing mysqladmin create :-p
The only thing which is not clear to me is whether
db_org and db_clone
should have the same user (and maybe the same password.)
Uwe Brauer
--
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: clone a database on the same machine
am 20.09.2010 13:01:36 von Johan De Meersman
--0016e642dab412cfe70490aed69c
Content-Type: text/plain; charset=ISO-8859-1
On Mon, Sep 20, 2010 at 12:48 PM, Uwe Brauer wrote:
> >>>>> On Mon, 20 Sep 2010 12:14:06 +0200, Johan De Meersman <
> vegivamp@tuxera.be> wrote:
>
> > He did suggest doing mysqladmin create :-p
>
> The only thing which is not clear to me is whether
> db_org and db_clone
> should have the same user (and maybe the same password.)
>
Databases and users are entirely separate concepts in MySQL. You could grant
the same user access to both databases, or you could create a new user that
only has access to the clone, however you feel works for you.
--
Bier met grenadyn
Is als mosterd by den wyn
Sy die't drinkt, is eene kwezel
Hy die't drinkt, is ras een ezel
--0016e642dab412cfe70490aed69c--
Re: clone a database on the same machine
am 20.09.2010 13:07:09 von a.smith
That entirely depends on your requirement, if you need it to be
accessible with the same username and password, then configure it with
the same username and password.
thanks Andy.
Quoting Uwe Brauer :
>>>>>> On Mon, 20 Sep 2010 12:14:06 +0200, Johan De Meersman
>>>>>> wrote:
>
> > He did suggest doing mysqladmin create :-p
>
> The only thing which is not clear to me is whether
> db_org and db_clone
> should have the same user (and maybe the same password.)
>
>
> Uwe Brauer
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/mysql?unsub=a.smith@ukgrid.net
>
>
--
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