简体   繁体   中英

How to backup stored procedure backup from Google Cloud SQL?

I want to create/export only the stored procedures from my Google Cloud SQL DB. I tried several commands on my phpmyadmin(installed on Google App Engine) console but I am consistently facing the error mentioned below.

List of commands I've tried:

1. mysqldump --routines=true -u root sarda_yogi_mobile > my_database.sql
2. mysqldump --databases database_name [-h instance-ip -u username -p password] \ --hex-blob --default-character-set=utf8 > database_file.sql
3. mysqldump --databases database_name [-h instance-ip -u username -p password] --default-character-set=utf8 > database_file.sql
4. mysqldump --host="127.0.0.1" --user="root" --password="" --routines --triggers --events dbname > my_file.sql

Error Message:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysqldump --routines=true -u root db_name > my_database.sql' at line 1

Can anyone point me in the right direction? Thank You :)

Those are commands you need to run on a command line, not via the phpMyAdmin shell.

If you want to perform an export from phpMyAdmin, there are some guides available on the web, eg http://www.inmotionhosting.com/support/website/phpmyadmin/export-database-using-phpmyadmin

As @Vadim said, you're attempting command-line statements at a SQL shell, which (as you've seen) doesn't work.

To perform a stored procedure export from within phpMyAdmin, go to the "Routines" tab of your database and click "Export" for the routine you wish to export. You could instead use the checkboxes to select several to export at once, if you prefer.

例程对话框

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM