Backup onle one procedure

Backup onle one procedure

am 10.02.2011 07:43:28 von Adarsh Sharma

Dear all,

I am researching all the ways to backup in mysql and donot able to find
a command that take individual backup of only one procedure in mysql.

I know this command and it needs some modification. Please help.

mysqldump -h192.168.0.10 -uroot -porkash --routines --no-create-info
--no-data --no-create-db --skip-opt test_crawler > adarsh.sql

Thanks & Regards
Adarsh Sharma

--
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: Backup onle one procedure

am 10.02.2011 08:17:49 von Johan De Meersman

--0015174bee000cad8e049be86117
Content-Type: text/plain; charset=ISO-8859-1

On Thu, Feb 10, 2011 at 7:43 AM, Adarsh Sharma wrote:

> I am researching all the ways to backup in mysql and donot able to find a
> command that take individual backup of only one procedure in mysql.
>

Have a look at the SHOW CREATE PROCEDURE syntax. It's not mysqldump, but it
will yield a statement that can recreate the given procedure from scratch.


--
Bier met grenadyn
Is als mosterd by den wyn
Sy die't drinkt, is eene kwezel
Hy die't drinkt, is ras een ezel

--0015174bee000cad8e049be86117--

Re: Backup onle one procedure

am 10.02.2011 08:55:21 von Ananda Kumar

--0016e65ae4dc4669aa049be8e7da
Content-Type: text/plain; charset=ISO-8859-1

there is -p option please used that.

On Thu, Feb 10, 2011 at 12:47 PM, Johan De Meersman wrote:

> On Thu, Feb 10, 2011 at 7:43 AM, Adarsh Sharma > >wrote:
>
> > I am researching all the ways to backup in mysql and donot able to find a
> > command that take individual backup of only one procedure in mysql.
> >
>
> Have a look at the SHOW CREATE PROCEDURE syntax. It's not mysqldump, but it
> will yield a statement that can recreate the given procedure from scratch.
>
>
> --
> Bier met grenadyn
> Is als mosterd by den wyn
> Sy die't drinkt, is eene kwezel
> Hy die't drinkt, is ras een ezel
>

--0016e65ae4dc4669aa049be8e7da--

Re: Backup onle one procedure

am 10.02.2011 09:33:06 von Ananda Kumar

--0016e65ae4dc460626049be96e76
Content-Type: text/plain; charset=ISO-8859-1

sorry, my bad.

Its -R and not -p.

regards
anandkl

On Thu, Feb 10, 2011 at 1:58 PM, Singer X.J. Wang wrote:

> Remember that procedure is defined per database,
>
> mysqldump -u[user] -p[pass] --where="db=`whatyouwant` and
> name=`whatyouwant`" mysql proc
>
>
> On Thu, Feb 10, 2011 at 02:55, Ananda Kumar wrote:
>
>> there is -p option please used that.
>>
>> On Thu, Feb 10, 2011 at 12:47 PM, Johan De Meersman >> >wrote:
>>
>> > On Thu, Feb 10, 2011 at 7:43 AM, Adarsh Sharma <
>> adarsh.sharma@orkash.com
>> > >wrote:
>> >
>> > > I am researching all the ways to backup in mysql and donot able to
>> find a
>> > > command that take individual backup of only one procedure in mysql.
>> > >
>> >
>> > Have a look at the SHOW CREATE PROCEDURE syntax. It's not mysqldump, but
>> it
>> > will yield a statement that can recreate the given procedure from
>> scratch.
>> >
>> >
>> > --
>> > Bier met grenadyn
>> > Is als mosterd by den wyn
>> > Sy die't drinkt, is eene kwezel
>> > Hy die't drinkt, is ras een ezel
>> >
>>
>
> --
> The best compliment you could give Pythian for our service is a referral.
>
>
>

--0016e65ae4dc460626049be96e76--

Re: Backup onle one procedure

am 10.02.2011 09:50:59 von Johan De Meersman

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

Hmm, I haven't seen the mail from Singer, yet.

On Thu, Feb 10, 2011 at 9:33 AM, Ananda Kumar wrote:

> On Thu, Feb 10, 2011 at 1:58 PM, Singer X.J. Wang wrote:
>
>> mysqldump -u[user] -p[pass] --where="db=`whatyouwant` and
>> name=`whatyouwant`" mysql proc
>>
>
Yes, I thought of that, too; but the manual explicitly states that manual
manipulation of the proc procedure isn't supported (which i presume to mean
there is no equivalent to *flush privileges*), so that's gonna take manual
reassembly to restore. The privileges to the procedure (creator/invoker and
so) are also in a separate table, procs_priv.

*Show create procedure* should yield a complete, executable statement that
recreates the procedure as-is.

Something to keep in mind, incidentally, is that security is *creator* by
default - the proc runs with the creator's privileges. If you migrate the
procedure to a host where that same user does not exist or has different
permissions, it might "mysteriously" not work. IMO, security should be set
to *invoker* by default, as that is also the more secure option - if you
don't have permission on the tables, I don't want you running stored procs
on them. That's for MySQL to change, though :-)


--
Bier met grenadyn
Is als mosterd by den wyn
Sy die't drinkt, is eene kwezel
Hy die't drinkt, is ras een ezel

--000e0cd116e2343dc4049be9aebb--