KobRheTilla
used register
Achso, ja das ist dann aber wirklich dumm. Auf dem Zielserver benutzt man einfach den User, der sowieso die Rechte an seiner DB hat.Er legt den Backupuser am ZIEL Server an,
Rob
Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
Achso, ja das ist dann aber wirklich dumm. Auf dem Zielserver benutzt man einfach den User, der sowieso die Rechte an seiner DB hat.Er legt den Backupuser am ZIEL Server an,
Achso, ja das ist dann aber wirklich dumm. Auf dem Zielserver benutzt man einfach den User, der sowieso die Rechte an seiner DB hat.
Rob
Er legt den Backupuser am ZIEL Server an
root@localhost [(none)]> create user 'backup'@'%' identified by 'backup';
Query OK, 0 rows affected (0.04 sec)
root@localhost [(none)]> create user 'backup'@'localhost' identified by 'backup';
Query OK, 0 rows affected (0.00 sec)
root@localhost [(none)]> grant all on *.* 'backup'@'%';
ERROR 1064 (42000): 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 ''backup'@'%'' at line 1
root@localhost [(none)]> grant all on *.* to 'backup'@'%';
Query OK, 0 rows affected (0.00 sec)
root@localhost [(none)]> grant all on *.* to 'backup'@'localhost';
Query OK, 0 rows affected (0.00 sec)
root@localhost [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)
root@localhost [(none)]>
$ mysqldump -u backup -pbackup -C ejemplo | mysql -h 192.168.1.55 -u root -pwerner ejemplo
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1130 (HY000): Host 'amd64.local' is not allowed to connect to this MySQL server
Warning: A partial dump from a server that has GTIDs will by default include the GTIDs of all transactions, even those that changed suppressed parts of the database. If you don't want to restore GTIDs, pass --set-gtid-purged=OFF. To make a complete dump, pass --all-databases --triggers --routines --events.
mysqldump: Got errno 32 on write
$
amd64.local ist der Quellhost mit der IP 192.168.1.34. Wieso klappt das jetzt dennoch nicht?
Oder man speichert den Dump lokal zwischen und macht es in zwei Schritten. Sooo groß wird die DB ja nicht sein und dann wird sicher deutlich verständlicher.
Weil das nicht klappen kann. Du brauchst den User am Zielhost, und musst auch dort die mysql auf 0.0.0.0 setzen.
Oder du verbindest dich vom Zielhost aus zum Quellhost.. Aber das hatten wir ja jetzt alles schon..
$ mysqldump -u backup -pbackup -C ejemplo | mysql -h 192.168.1.55 -u root -pwerner ejemplo
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1130 (HY000): Host 'amd64.local' is not allowed to connect to this MySQL server
Warning: A partial dump from a server that has GTIDs will by default include the GTIDs of all transactions, even those that changed suppressed parts of the database. If you don't want to restore GTIDs, pass --set-gtid-purged=OFF. To make a complete dump, pass --all-databases --triggers --routines --events.
mysqldump: Got errno 32 on write
$ mysqldump -u backup -pbackup -C ejemplo | mysql -h 192.168.1.55 -u backup -pbackup ejemplo
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysql: [Warning] Using a password on the command line interface can be insecure.
Warning: A partial dump from a server that has GTIDs will by default include the GTIDs of all transactions, even those that changed suppressed parts of the database. If you don't want to restore GTIDs, pass --set-gtid-purged=OFF. To make a complete dump, pass --all-databases --triggers --routines --events.
ERROR 1049 (42000): Unknown database 'ejemplo'
mysqldump: Got errno 32 on write
$ mysqldump -u backup -pbackup -C --add-drop-database ejemplo | mysql -h 192.168.1.55 -u backup -pbackup ejemplo
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysql: [Warning] Using a password on the command line interface can be insecure.
Warning: A partial dump from a server that has GTIDs will by default include the GTIDs of all transactions, even those that changed suppressed parts of the database. If you don't want to restore GTIDs, pass --set-gtid-purged=OFF. To make a complete dump, pass --all-databases --triggers --routines --events.
ERROR 1049 (42000): Unknown database 'ejemplo'
mysqldump: Got errno 32 on write
$ mysqldump -u backup -pbackup -C ejemplo | mysql -h 192.168.1.55 -u backup -pbackup ejemplo
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysql: [Warning] Using a password on the command line interface can be insecure.
Warning: A partial dump from a server that has GTIDs will by default include the GTIDs of all transactions, even those that changed suppressed parts of the database. If you don't want to restore GTIDs, pass --set-gtid-purged=OFF. To make a complete dump, pass --all-databases --triggers --routines --events.
ERROR 1840 (HY000) at line 24: @@GLOBAL.GTID_PURGED can only be set when @@GLOBAL.GTID_EXECUTED is empty.
mysqldump: Got errno 32 on write
$ mysqldump -h 192.168.1.34 -u backup -pbackup -C ejemplo | mysql -u backup -pbackup ejemplo
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1049 (42000): Unknown database 'ejemplo'
Warning: A partial dump from a server that has GTIDs will by default include the GTIDs of all transactions, even those that changed suppressed parts of the database. If you don't want to restore GTIDs, pass --set-gtid-purged=OFF. To make a complete dump, pass --all-databases --triggers --routines --events.
mysqldump: Got errno 32 on write
$ mysqldump -h 192.168.1.34 -u backup -pbackup -C --add-drop-database ejemplo | mysql -u backup -pbackup ejemplo
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1049 (42000): Unknown database 'ejemplo'
Warning: A partial dump from a server that has GTIDs will by default include the GTIDs of all transactions, even those that changed suppressed parts of the database. If you don't want to restore GTIDs, pass --set-gtid-purged=OFF. To make a complete dump, pass --all-databases --triggers --routines --events.
mysqldump: Got errno 32 on write
$ mysqldump -h 192.168.1.34 -u backup -pbackup -C --add-drop-database ejemplo | mysql -u backup -pbackup ejemplo
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysql: [Warning] Using a password on the command line interface can be insecure.
Warning: A partial dump from a server that has GTIDs will by default include the GTIDs of all transactions, even those that changed suppressed parts of the database. If you don't want to restore GTIDs, pass --set-gtid-purged=OFF. To make a complete dump, pass --all-databases --triggers --routines --events.
ERROR 1840 (HY000) at line 24: @@GLOBAL.GTID_PURGED can only be set when @@GLOBAL.GTID_EXECUTED is empty.
mysqldump: Got errno 32 on write
mysqldump -h 192.168.1.34 -u backup -pbackup -C --add-drop-database --databases ejemplo | mysql -u backup -pbackup
Wenn er dann noch meckert hast du vielleicht vor lauter rumprobieren was zerschossen
Hast du die mysql auf beiden Servern ganz normal mit pkg installiert? Und bis auf die bind-options nichts verändert? GTIDs sollten da eigentlich nichts zu melden haben..
[10 Jan 2013 12:43] Jon Stephens
Fixed in 5.6+, documented as follows in the 5.6.11 and 5.7.1 changelogs:
In order to provision or to restore a server using GTIDs, it is
possible to set @@GLOBAL.GTID_PURGED to a given GTID set
specifying the transactions that were imported. This operation
requires that @@GLOBAL.GTID_EXECUTED as well as
@@GLOBAL.GTID_PURGED are empty, in order to avoid possible
actions that would override server executed GTIDs. When this
requirement was not met, the error message -GTID_PURGED can only
be set when GTID_EXECUTED is empty- did not specify the scope of
the affected variables.
In order to avoid confusion, error messages that refer to
variables relating to GTIDs now include the variable scope.
Closed.
auf dem Zielserver (ACHTUNG!) "reset master;" ausführen. Das sollte dort alle Logs löschen und die GTIDs resetten.
Das soll heißen, auf dem Quell-Host einloggen. Dann auf den lokalen MySQL-Server mit mysql und dem User (-u) zugreifen, der den Dump durchführen soll und den Host (-h) nutzen, der auch später beim Dump benutzt wird, also localhost oder 127.0.0.1.Bitte genauer? Und macht es einen Unterschied, ob mysql auf FreeBSD oder auf Windows installiert ist? Auf beiden Rechnern habe ich FreeBSD installiert, ich hätte aber auch noch ein Laptop mit Windows.
Das wurde Dir von mysqldump als Warnung auch empfohlen. :-)Danke! Mit dem Parameter --set-gtid-purged=OFF hat es endlich geklappt! Was ich nicht ganz verstehe ist
"reset master" wo/wie genau? In der mysql-Konsole? Die Datenbank (wie gesagt 5,6 GB groß) ist aber leider nicht ganz auf dem Zielhost (Laptop mit 2 GB RAM und 2 GB swap) angekommen. Liegt aber wahrscheinlich dann am Speicherlimit, obwohl während des ganzen Vorgangs ein "top" auf dem Laptop die swap die ganze Zeit als unbenutzt gemeldet hat, was ich dann nicht verstehe...
Das wurde Dir von mysqldump als Warnung auch empfohlen. :-)
$ more /usr/local/etc/mysql/my.cnf
# $FreeBSD: head/databases/mysql57-server/files/my.cnf.sample.in 414707 2016-05-06 14:39:59Z riggs $
[client]
port = 3306
socket = /tmp/mysql.sock
[mysql]
prompt = \u@\h [\d]>\_
no_auto_rehash
[mysqld]
user = mysql
port = 3306
socket = /tmp/mysql.sock
bind-address = 127.0.0.1
basedir = /usr/local
datadir = /var/db/mysql
tmpdir = /var/db/mysql_tmpdir
slave-load-tmpdir = /var/db/mysql_tmpdir
secure-file-priv = /var/db/mysql_secure
log-bin = mysql-bin
log-output = TABLE
master-info-repository = TABLE
relay-log-info-repository = TABLE
relay-log-recovery = 1
slow-query-log = 1
server-id = 1
sync_binlog = 1
sync_relay_log = 1
binlog_cache_size = 16M
expire_logs_days = 30
default_password_lifetime = 0
enforce-gtid-consistency = 1
gtid-mode = ON
safe-user-create = 1
lower_case_table_names = 1
explicit-defaults-for-timestamp = 1
myisam-recover-options = BACKUP,FORCE
open_files_limit = 32768
table_open_cache = 16384
table_definition_cache = 8192
net_retry_count = 16384
key_buffer_size = 256M
max_allowed_packet = 64M
query_cache_type = 0
query_cache_size = 0
long_query_time = 0.5
innodb_buffer_pool_size = 1G
innodb_data_home_dir = /var/db/mysql
innodb_log_group_home_dir = /var/db/mysql
innodb_data_file_path = ibdata1:76M:autoextend
innodb_temp_data_file_path = ibtmp1:128M:autoextend
innodb_flush_method = O_DIRECT
innodb_log_file_size = 256M
innodb_log_buffer_size = 16M
innodb_write_io_threads = 8
innodb_read_io_threads = 8
innodb_autoinc_lock_mode = 2
skip-symbolic-links
[mysqldump]
max_allowed_packet = 256M
quote_names
quick
$
Ich wüsste nicht, dass mysql eine my.ini liest.
Warum in einem Schritt? Wenn es wirklich um ein Backup geht, ist einDie Datenbank ist 5,6 GB groß und es soll in einem Schritt gemacht werden.
mysqldump | mysql
konzeptionell völliger Murks und wird fast sicher irgendwann zu Tränen führen. Da einfach unendlich viel bei schiefgehen. Es geht damit los, dass du dein Backup überschreibst, bevor du ein neues Backup gezogen hast. Was ist, wenn gerade während des Backuplaufs der Server stirbt? Oder wenn dir nach dem Backuplauf auffällt, dass auf dem Server etwas kaputt ist und das Backup bräuchtest? Dazu kommt die Möglichkeit eines Netzwerkfehlers, stirbt dir dir Netzwerkverbindung während des Backuplaufs, ist das Backup im Eimer. mysqldumo
herumstricken. Das Script führt mysqldump
aus und komprimiert die Ausgabe, legt sie im Dateisystem ab und löscht sie erst nach einiger Zeit. So hat man immer eine gewisse Anzahl Backups, über welche man im Problemfall zurückgehen kann. Außerdem berechnet das idealerweise noch eine Prüfsumme auf den Dump, anhand derer man später Bitrot ausschließen kann. Und es prüft die Fehelrcodes, gab es einen Fehler reagiert es entsprechend.Das ist aber definitiv keine default my.cnf wie sie freebsd anlegt, und da ich schon gefragt habe, ob du etwas an der installation verändert hast...
mysqldump | mysql
scheint aber für kleine Datenbanken unproblematisch zu sein./etc/rc.conf
generell möglich sind, so wie etwa mysql_args="--bind-address = 0.0.0.0"
? Ich habe leider nichts dazu gefunden.Wir verwenden essentielle Cookies, damit diese Website funktioniert, und optionale Cookies, um den Komfort bei der Nutzung zu verbessern.
Siehe weitere Informationen und konfiguriere deine Einstellungen