backup_database_from_remote_server
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| backup_database_from_remote_server [2016/08/02 22:42] – created walkeradmin | backup_database_from_remote_server [2016/12/14 18:38] (current) – walkeradmin | ||
|---|---|---|---|
| Line 5: | Line 5: | ||
| \\ | \\ | ||
| sudo apt-get install mysql-client (this will install among other things mysqldump) | sudo apt-get install mysql-client (this will install among other things mysqldump) | ||
| + | \\ | ||
| + | Now you can do the backup, there are a couple of considerations: | ||
| + | \\ | ||
| + | \\ | ||
| + | 1. Your user must have the rights (normally user accounts are localhost limited) I created a user with global rights ' | ||
| + | \\ | ||
| + | \\ | ||
| + | < | ||
| + | CREATE USER ' | ||
| + | |||
| + | EG: CREATE USER ' | ||
| + | | ||
| + | Once created, the user requires permissions | ||
| + | | ||
| + | GRANT ALL PRIVILEGES ON * . * TO ' | ||
| + | | ||
| + | If you want to be able to access the server from anywhere, replace localhost with % | ||
| + | | ||
| + | GRANT ALL PRIVILEGES ON * . * TO ' | ||
| + | </ | ||
| + | \\ | ||
| + | \\ | ||
| + | <color red> SUPER IMPORTANT</ | ||
| + | \\ | ||
| + | \\ | ||
| + | skip-networking\\ | ||
| + | bind-address = 127.0.0.1\\ | ||
| + | \\ | ||
| + | 2. You must have rights to write to the target directory (easily overlooked)\\ | ||
| + | 3. The backup might take a few minutes, be prepared to wait.\\ | ||
| + | \\ | ||
| + | Now we can execute the following command: | ||
| + | | ||
| + | mysqldump --host ipaddress -P port -u user -pPassword databasename > savename.sql | ||
| + | | ||
| + | mysqldump --host 10.0.0.1 -P 3306 -u root -pRootPassword gallery > gallery.sql | ||
| + | \\ | ||
| \\ | \\ | ||
| | | ||
backup_database_from_remote_server.1470177736.txt.gz · Last modified: (external edit)
