MySQL backup and Restoration Techniques

Source: Internet
Author: User
Dump stored programs (functions and programs) in the dumped database ). The output produced by --- routines contains the CREATEPROCEDURE and CREATEFUNCTION statements to recreate the child

Dump stored programs (functions and programs) in the dumped database ). The output produced by --- routines contains the create procedure and create function statements to recreate the child

Dump stored programs (functions and programs) in the dumped database ). The output produced using --- routines contains the create procedure and create function statements to recreate the subroutine. However, these statements do not include attributes, such as subprogram definers or create or modify timestamps. This indicates that when the subprograms are overloaded, the user should be set as the overload user when they are created, and the timestamp is equal to the overload time.

If you want to create a subroutine that uses the original definer and timestamp attributes, -- routines is not used. Instead, use a mysql account with the corresponding permissions of the MySQL database to directly dump and reload the contents of the mysql. proc table.

Show procedure status;

Show create procedure autoinsert;

DELIMITER ;;

Create procedure 'autoinsert '()
Begin
Declare I int;
Set I = 1;
While (I <100000) do
Insert into t10 values (I, 'name ');
Set I = I + 1;
End while;
END ;;

DELIMITER;

Back up mysqldump-u root-p123 -- socket =/usr/local/mysql1/var/mysql. sock-R -- no-data -- no-create-db -- no-create-info -- all-database>/root/mysqllog/test. SQL

Mysqldump-u root-p123 -- socket =/usr/local/mysql1/var/mysql. sock mysql proc>/root/mysqllog/test. SQL

Restore source/root/mysqllog/test. SQL

Use mysql
Source/root/mysqllog/test. SQL

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.