Backup onle one procedure

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 [at] m.gmane.org
Adarsh Sharma [ Do, 10 Februar 2011 07:43 ] [ ID #2054913 ]

Re: Backup onle one procedure

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

On Thu, Feb 10, 2011 at 7:43 AM, Adarsh Sharma <adarsh.sharma [at] 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

--0015174bee000cad8e049be86117--
Johan De Meersman [ Do, 10 Februar 2011 08:17 ] [ ID #2054914 ]

Re: Backup onle one procedure

--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 <vegivamp [at] tuxera.be>wrote:

> On Thu, Feb 10, 2011 at 7:43 AM, Adarsh Sharma <adarsh.sharma [at] 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
>

--0016e65ae4dc4669aa049be8e7da--
Ananda Kumar [ Do, 10 Februar 2011 08:55 ] [ ID #2054915 ]

Re: Backup onle one procedure

--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 <wang [at] singerwang.com>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 <anandkl [at] gmail.com> wrote:
>
>> there is -p option please used that.
>>
>> On Thu, Feb 10, 2011 at 12:47 PM, Johan De Meersman <vegivamp [at] tuxera.be
>> >wrote:
>>
>> > On Thu, Feb 10, 2011 at 7:43 AM, Adarsh Sharma <
>> adarsh.sharma [at] 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--
Ananda Kumar [ Do, 10 Februar 2011 09:33 ] [ ID #2054916 ]

Re: Backup onle one procedure

--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 <anandkl [at] gmail.com> wrote:

> On Thu, Feb 10, 2011 at 1:58 PM, Singer X.J. Wang <wang [at] singerwang.com>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--
Johan De Meersman [ Do, 10 Februar 2011 09:50 ] [ ID #2054917 ]
Datenbanken » gmane.comp.db.mysql.general » Backup onle one procedure

Vorheriges Thema: MySQL Proxy - Select Proxy On Auth
Nächstes Thema: BLOB data gets encoded as utf8!