All Projects → qubitstream → Phpmyadmin_sql_backup

qubitstream / Phpmyadmin_sql_backup

A Python script to automate SQL dumps via phpMyAdmin's web interface

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Phpmyadmin sql backup

Backup Manager
Database backup manager for dumping to and restoring databases from S3, Dropbox, FTP, SFTP, and Rackspace Cloud
Stars: ✭ 1,589 (+9247.06%)
Mutual labels:  database, mysql, backup
Backup
MySQL Database backup package for Laravel
Stars: ✭ 66 (+288.24%)
Mutual labels:  database, mysql, backup
Mirth Connect Docker
Mirth-Connect Docker container (+ Mysql container + PHPMyAdmin container)
Stars: ✭ 29 (+70.59%)
Mutual labels:  phpmyadmin, database, mysql
Agent
The best way to backup and restore your database
Stars: ✭ 80 (+370.59%)
Mutual labels:  database, mysql, backup
Holland
Holland Backup Manager
Stars: ✭ 132 (+676.47%)
Mutual labels:  database, mysql, backup
Mysqldump
Node Module to Create a Backup from MySQL
Stars: ✭ 136 (+700%)
Mutual labels:  database, mysql, backup
Backup
Easy full stack backup operations on UNIX-like systems.
Stars: ✭ 4,682 (+27441.18%)
Mutual labels:  database, mysql, backup
Laravel Db Snapshots
Quickly dump and load databases
Stars: ✭ 650 (+3723.53%)
Mutual labels:  database, mysql
Bareos
Main repository with the code for the libraries and daemons
Stars: ✭ 651 (+3729.41%)
Mutual labels:  mysql, backup
Mysqlconnection
Simple library to make it much easier to use MySQL in Visual Studio projects
Stars: ✭ 6 (-64.71%)
Mutual labels:  database, mysql
Tidb
TiDB is an open source distributed HTAP database compatible with the MySQL protocol
Stars: ✭ 29,871 (+175611.76%)
Mutual labels:  database, mysql
Leafpub
Simple, beautiful, open source publishing.
Stars: ✭ 645 (+3694.12%)
Mutual labels:  database, mysql
Phpmyadmin
A web interface for MySQL and MariaDB
Stars: ✭ 5,750 (+33723.53%)
Mutual labels:  phpmyadmin, mysql
Blog
Everything about database,business.(Most for PostgreSQL).
Stars: ✭ 6,330 (+37135.29%)
Mutual labels:  database, mysql
Easydb
Easy-to-use PDO wrapper for PHP projects.
Stars: ✭ 624 (+3570.59%)
Mutual labels:  database, mysql
Metabase
The simplest, fastest way to get business intelligence and analytics to everyone in your company 😋
Stars: ✭ 26,803 (+157564.71%)
Mutual labels:  database, mysql
Dbshield
Database firewall written in Go
Stars: ✭ 620 (+3547.06%)
Mutual labels:  database, mysql
Database rewinder
minimalist's tiny and ultra-fast database cleaner
Stars: ✭ 685 (+3929.41%)
Mutual labels:  database, mysql
Baikaldb
BaikalDB, A Distributed HTAP Database.
Stars: ✭ 707 (+4058.82%)
Mutual labels:  database, mysql
Goloquent
This repo no longer under maintenance, please go to https://github.com/si3nloong/sqlike
Stars: ✭ 16 (-5.88%)
Mutual labels:  database, mysql

phpmyadmin_sql_backup.py

What is it?

A Python 3 script to automate the download of SQL backups via a phpMyAdmin web interface.

This is useful when your web hosting provider does not grant you access to a console (for mysqldump) but you want to automate the backup of your database (without having to manually use the browser).

It has been tested with Python 3.4+ on Linux and Windows and the following versions of phpMyAdmin: 4.3.x - 4.8.x, 5.0.0

Note: The web interface of phpMyAdmin may change in the future and break this script. Please file a bug report (including your version of phpMyAdmin) if you encounter this issue.

Usage

usage: phpmyadmin_sql_backup.py [-h] [-o OUTPUT_DIRECTORY] [-p]
                                [-e EXCLUDE_DBS] [-s SERVER_NAME]
                                [--compression {none,zip,gzip}]
                                [--basename BASENAME] [--timeout TIMEOUT]
                                [--overwrite-existing]
                                [--prefix-format PREFIX_FORMAT] [--dry-run]
                                [--http-auth HTTP_AUTH]
                                URL USERNAME PASSWORD

Automates the download of SQL dump backups via a phpMyAdmin web interface.

positional arguments:
  URL                   phpMyAdmin login page url
  USERNAME              phpMyAdmin login username
  PASSWORD              phpMyAdmin login password

optional arguments:
  -h, --help            show this help message and exit
  -o OUTPUT_DIRECTORY, --output-directory OUTPUT_DIRECTORY
                        output directory for the SQL dump file (default: the
                        current working directory)
  -p, --prepend-date    prepend current UTC date & time to the filename; see
                        the --prefix-format option for custom formatting
  -e EXCLUDE_DBS, --exclude-dbs EXCLUDE_DBS
                        comma-separated list of database names to exclude from
                        the dump
  -s SERVER_NAME, --server-name SERVER_NAME
                        mysql server hostname to supply if enabled as field on
                        login page
  --compression {none,zip,gzip}
                        compression method for the output file - must be
                        supported by the server (default: none)
  --basename BASENAME   the desired basename (without extension) of the SQL
                        dump file (default: the name given by phpMyAdmin); you
                        can also set an empty basename "" in combination with
                        --prepend-date and --prefix-format
  --timeout TIMEOUT     timeout in seconds for the requests (default: 60)
  --overwrite-existing  overwrite existing SQL dump files (instead of
                        appending a number to the name)
  --prefix-format PREFIX_FORMAT
                        the prefix format for --prepend-date (default:
                        "%Y-%m-%d--%H-%M-%S-UTC_"); in Python's strftime
                        format. Must be used with --prepend-date to be in
                        effect
  --dry-run             dry run, do not actually download any file
  --http-auth HTTP_AUTH
                        Basic HTTP authentication, using format
                        "username:password"

Written by Christoph Haunschmidt et al., version: 2019-05-07.1

Examples

phpmyadmin_sql_backup.py "http://www.example.com/phpmyadmin/" your_user your_password

Downloads a plain text .sql backup of all databases to the current working directory.


phpmyadmin_sql_backup.py "http://www.example.com/phpmyadmin/" your_user your_password --exclude-dbs mydb2,mydb4 --prepend-date --basename example_dump --output-directory /tmp --compression zip

Downloads a zipped dump with databases mydb2 & mydb4 excluded, the base name example_dump and a prepended UTC date / time to the directory /tmp, e.g. /tmp/2016-03-11--15-19-04-UTC_example_dump.zip.

Requirements

Note for Windows users: while it is possible to install the requirements natively, it is often easier to use the Windows Subsystem for Linux if you are using Windows 10

Changelog

Currently, there is no changelog; the best option at the moment is to read the commit messages.

License

GNU GPL3

Contributors

  • Christoph Haunschmidt (original author)
  • Jason Harper (optional mysql server hostname)
  • Jonas Bengtsson (older frame-based phpMyAdmin support)
  • Benoît Courtine (HTTP Auth)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].