
Backup MySQL Database - Google drive Integration
No credit card required

Backup MySQL Database - Google drive Integration
No credit card required
Effortlessly back up your MySQL database with our Apify actor. It securely connects to your database, generates full SQL backups, and stores them on Google Drive, FTP servers, or Apify Key-Value Store. Ensure data safety with seamless storage and sharing options tailored to your needs.
Backup MySQL Database Actor
Easily back up your MySQL database with this Apify actor. It securely connects to your database, performs a full backup, and saves the output in SQL format. This actor supports multiple storage and sharing options, including Apify Key-Value Store, Google Drive, and FTP servers, ensuring your data is safe and accessible.
Overview
This actor:
- Connects to a MySQL database using the provided credentials.
- Backs up all tables and data from the specified database.
- Saves the backup as an SQL file.
- Supports multiple storage options, including Apify Key-Value Store, Google Drive, and FTP servers.
- Optionally sends the backup to the specified email address.
- Retains backups longer than 7 days if configured with Apify Key-Value Store.
Input Parameters
The following input parameters are required to configure the actor:
MySQL Connection Details
-
host
(required):- Type:
string
- Description: The hostname or IP address of the MySQL server.
- Type:
-
user
(required):- Type:
string
- Description: The username for the MySQL database.
- Type:
-
password
(required):- Type:
string
- Description: The password for the MySQL user.
- Type:
-
database
(required):- Type:
string
- Description: The name of the database to back up.
- Type:
-
port
(optional):- Type:
integer
- Description: The port number of the MySQL database. Default is
3306
. - Prefill:
3306
- Type:
Backup Sharing Options
-
email
(optional):- Type:
string
- Description: The email address where the backup will be sent.
- Type:
-
keyValueStorage
(optional):- Type:
string
- Description: The Apify Key-Value Store to retain backups for longer than 7 days. Create a new Key-Value Store in the Apify platform if none exists.
- Type:
Google Drive Integration
driveFolderId
(optional):- Type:
string
- Description: The folder ID of the Google Drive shared folder where the backup will be uploaded.
- Instructions: Share the folder with
backup-mysql-database-apify@generative-ai-model.iam.gserviceaccount.com
and assign editor permissions.
- Type:
FTP Backup Options
-
ftphost
(optional):- Type:
string
- Description: The hostname or IP address of the FTP server.
- Type:
-
ftpuser
(optional):- Type:
string
- Description: The username for the FTP server.
- Type:
-
ftppassword
(optional):- Type:
string
- Description: The password for the FTP user.
- Type:
-
ftpport
(optional):- Type:
integer
- Description: The port number of the FTP server. Default is
21
.
- Type:
-
ftpsecure
(optional):- Type:
boolean
- Description: Indicates whether the FTP server supports FTPS (secure protocol). Default is
false
.
- Type:
How It Works
-
Connects to the Database:
- The actor connects to the MySQL database using the provided credentials.
-
Queries Tables:
- It retrieves all table names using the
SHOW TABLES
command.
- It retrieves all table names using the
-
Performs Backup:
- Backs up all tables and their data into an SQL file containing
INSERT
statements.
- Backs up all tables and their data into an SQL file containing
-
Saves Backup:
- Saves the backup locally and uploads it to the configured storage options.
-
Shares Backup:
- Optionally sends the backup via email or uploads it to Google Drive and/or FTP servers.
-
Key-Value Store Integration:
- Retains the backup in the Apify Key-Value Store for longer-term storage (if configured).
-
Closes Connection:
- Safely terminates the database connection after the backup is completed.
Usage Instructions
Step 1: Configure Input Parameters
Prepare your input JSON as follows:
1{ 2 "host": "example.mysql.com", 3 "user": "admin", 4 "password": "securepassword", 5 "database": "example_db", 6 "port": 3306, 7 "email": "backup@example.com", 8 "keyValueStorage": "MyKeyValueStore", 9 "driveFolderId": "1x2y3zExampleFolderID", 10 "ftphost": "ftp.example.com", 11 "ftpuser": "ftp_user", 12 "ftppassword": "ftp_password", 13 "ftpport": 21, 14 "ftpsecure": true 15}
Step 2: Run the Actor
- Create an Apify actor and paste the provided input JSON into the input schema.
- Execute the actor to initiate the backup process.
- Monitor the progress in the Apify console.
Step 3: Access Backup Files
- Download the SQL backup file from the Apify Key-Value Store.
- Retrieve it from your Google Drive or FTP server if those options were configured.
Features
- Multiple Storage Options: Supports Apify Key-Value Store, Google Drive, and FTP.
- Customizable Settings: Specify email, port numbers, and security protocols.
- Retention Control: Use Apify Key-Value Store to retain backups for more than 7 days.
- SQL Output Format: Backups are generated in universally compatible SQL format.
FAQs
-
What happens if the backup fails?
- Check the Apify logs for detailed error messages. Common issues include incorrect credentials or insufficient permissions.
-
Can I back up multiple databases?
- Currently, this actor supports one database at a time. To back up multiple databases, run the actor separately for each database.
-
How do I share Google Drive folders?
- Ensure the folder is shared with
backup-mysql-database-apify@generative-ai-model.iam.gserviceaccount.com
and assign editor permissions.
- Ensure the folder is shared with
Contact and Support
For support or inquiries, contact the developer at: worldunboxer1@gmail.com
.
Disclaimer
This actor does not guarantee error-free backups. It is the user's responsibility to verify the integrity and completeness of the backups. Ensure proper configurations and permissions are in place before running the actor.
Actor Metrics
2 monthly users
-
1 bookmark
>99% runs succeeded
Created in Jan 2025
Modified 20 days ago