How to Backup and Restore (Export and Import) MySQL Databases Tutorial Wie Backup-und Restore (Export und Import) Datenbanken MySQL Tutorial

phpMyAdmin can be used to export or backup MySQL databases easily. phpMyAdmin kann verwendet werden, zu exportieren oder Backup-MySQL-Datenbanken einfach. However, if the database size is very big, it probably won’t be a good idea. Allerdings, wenn die Datenbank-Größe ist sehr groß, es wird wahrscheinlich nicht für eine gute Idee. phpMyAdmin allows users to save database dump as file or display on screen, which involves exporting SQL statements from the server, and transmitting the data across slower network connection or Internet to user’s computer. phpMyAdmin erlaubt es Benutzern zu speichern Datenbank-Dump-Datei oder als Anzeige auf dem Bildschirm aus, woraus sich Exportieren von SQL-Anweisungen von dem Server, und Übermittlung der Daten über langsamere Netzwerkverbindung oder Internet-Benutzer auf dem Computer. This process slow the exporting process, increase database locking time and thus MySQL unavailability, slow the server and may simply crash the Apache HTTPD server if too many incoming web connections hogging the system’s resources. Dieser Prozess langsam den ausführenden Prozess, erhöhen Datenbank Locking Zeit und somit MySQL Nichtverfügbarkeit, langsam dem Server und können einfach Absturz des Apache HTTPD-Server, wenn zu viele eingehende Verbindungen Web-hogging das System-Ressourcen.

The better way to backup and export MySQL database is by doing the task locally on the server, so that the tables’ data can be instantly dumped on the local disk without delay. Der bessere Weg, um Backup-und Export MySQL-Datenbank ist, indem Sie die Aufgabe lokal auf dem Server, so dass die Tabellen "Daten können sofort Dumpingpreisen auf der lokalen Platte ohne Verzögerung. Thus export speed will be faster and reduce the time MySQL database or table is locked for accessing. So exportieren Geschwindigkeit wird schneller und Verkürzung der Zeit, MySQL-Datenbank oder Tabelle ist für den Zugriff gesperrt. This tutorial is the guide on how to backup (export) and restore (import) MySQL database(s) on the database server itself by using the mysqldump and mysql utilities. Dieses Tutorial ist die Anleitung, wie man Backup (Export) und Wiederherstellung (Import) MySQL Datenbank (en) auf dem Datenbank-Server selbst, indem Sie die mysqldump mysql-und Versorgungsunternehmen. There are basically two methods to backup MySQL, one is by copying all table files (*.frm, *.MYD, and *.MYI files) or by using mysqlhotcopy utility, but it only works for MyISAM tables. Es gibt grundsätzlich zwei Methoden zur Sicherung von MySQL, wird man durch Kopieren alle Tisch-Dateien (*. frm, *. MYD und *. MYI-Dateien) oder durch die Verwendung mysqlhotcopy Nutzen, aber es funktioniert nur bei MyISAM-Tabellen. Below tutorial will concentrate on mysqldump which works for both MyISAM and InnoDB tables. Unten Tutorial wird sich auf mysqldump der Werke für beide MyISAM-und InnoDB-Tabellen.

How to Export or Backup or Dump A MySQL Database Wie zum Export oder Backup oder Dump einer MySQL-Datenbank

To export a MySQL database into a dump file, simply type the following command syntax in the shell. So exportieren Sie eine MySQL-Datenbank in eine Dump-Datei, geben Sie einfach die folgende Befehlssyntax in der Außenhaut. You can use Telnet or SSH to remotely login to the machine if you don’t have access to the physical box. Sie können Telnet oder SSH remote login auf der Maschine, wenn Sie keinen Zugriff auf die physischen Feld.

mysqldump -u username -p password database_name > dump.sql mysqldump-u username-p Passwort database_name> dump.sql

Replace username with a valid MySQL user ID, password with the valid password for the user (IMPORTANT: no space after -p and the password, else mysqldump will prompt you for password yet will treat the password as database name, so the backup will fail) and database_name with the actual name of the database you want to export. Ersetzen Sie username mit einem gültigen MySQL-Benutzer-ID, Passwort, mit dem gültigen Passwort für den Benutzer (WICHTIG: keine Leerzeichen nach-p und dem Passwort, sonst mysqldump werden Sie das Passwort noch zu behandeln wie das Passwort-Datenbank Namen, so dass die Backup scheitert ) Und der Datenbankname mit den eigentlichen Namen der Datenbank, die Sie exportieren wollen. Finally, you can put whatever name you like for the output SQL dump file, here been dump.sql . Schließlich können Sie einen beliebigen Namen, den Sie wie für die Ausgabe von SQL-Dump-Datei, hier wurden dump.sql.

The while data, tables, structures and database of database_name will be backed up into a SQL text file named dump.sql with the above command. Die while Daten, Tabellen, die Strukturen und die Datenbank der Datenbankname werden gesichert werden in einer SQL-Textdatei mit dem Namen dump.sql mit den oben genannten Befehl.

How to Export A MySQL Database Structures Only Wie zur Ausfuhr einer MySQL-Datenbank-Strukturen nur

If you no longer need the data inside the database’s tables (unlikely), simply add –no-data switch to export only the tables’ structures. Wenn Sie nicht mehr brauchen die Daten innerhalb der Datenbank-Tabellen (eher unwahrscheinlichen), fügen Sie einfach-no-Schalter Daten zu exportieren nur die Tabellen "Strukturen. For example, the syntax is: Zum Beispiel ist die Syntax:

mysqldump -u username -p password –no-data database_name > dump.sql mysqldump-u username-p Passwort-no-Daten database_name> dump.sql

How to Backup Only Data of a MySQL Database Wie Nur Backup von Daten einer MySQL-Datenbank

If you only want the data to be backed up, use –no-create-info option. Wenn Sie nur wollen, dass die Daten gesichert werden, verwenden Sie-no-create-info Option. With this setting, the dump will not re-create the database, tables, fields, and other structures when importing. Mit dieser Einstellung wird der Dump nicht neu erstellen der Datenbank, Tabellen, Felder und anderen Strukturen bei der Einfuhr. Use this only if you pretty sure that you have a duplicate databases with same structure, where you only need to refresh the data. Verwenden Sie diese nur, wenn Sie ziemlich sicher, dass Sie über ein Duplikat Datenbanken mit derselben Struktur, wo Sie müssen nur die Daten aktualisieren.

mysqldump -u username -p password –no-create-info database_name > dump.sql mysqldump-u username-p Passwort-no-create-info database_name> dump.sql

How to Dump Several MySQL Databases into Text File How to dump mehrere MySQL-Datenbanken in Text-Datei

–databases option allows you to specify more than 1 database. Datenbanken-Option ermöglicht es Ihnen, mehr als 1 Datenbank. Example syntax: Beispiel Syntax:

mysqldump -u username -p password –databases db_name1 [db_name2 ...] > dump.sql mysqldump-u username-p Passwort-Datenbanken db_name1 [db_name2 ...]> dump.sql

How to Dump All Databases in MySQL Server Wie zu dumpen alle Datenbanken in den MySQL-Server

To dump all databases, use the –all-databases option, and no databases’ name need to be specified anymore. Dumpen alle Datenbanken, verwenden Sie das-alles-Datenbanken Option, und keine Datenbanken 'name müssen angegeben werden mehr.

mysqldump -u username -p password –all-databases > dump.sql mysqldump-u username-p Passwort-all-databases> dump.sql

How to Online Backup InnoDB Tables Wie zu Online-Backup-InnoDB-Tabellen

Backup the database inevitable cause MySQL server unavailable to applications because when exporting, all tables acquired a global read lock using FLUSH TABLES WITH READ LOCK at the beginning of the dump until finish. Backup der Datenbank unvermeidlich dazu führen, dass MySQL-Server-Anwendungen nicht zur Verfügung stehen, da beim Export, alle Tabellen erworben eine globale Lesesperre mit FLUSH TABLES WITH READ LOCK zu Beginn des Dump bis zum Ende. So although READ statements can proceed, all INSERT, UPDATE and DELETE statements will have to queue due to locked tables, as if MySQL is down or stalled. Und obwohl LESEN Aussagen können, werden alle INSERT, UPDATE und DELETE-Anweisungen müssen die Warteschlange aufgrund Tabellen gesperrt, als ob MySQL ist oder ins Stocken geraten. If you’re using InnoDB, –single-transaction is the way to minimize this locking time duration to almost non-existent as if performing an online backup. Wenn Sie InnoDB-single-Transaktion ist der Weg zur Minimierung dieser Zeit Sperren Dauer von fast nicht existent, als ob die Durchführung einer Online-Sicherung. It works by reading the binary log coordinates as soon as the lock has been acquired, and lock is then immediately released. Es funktioniert durch das Lesen der Binär-Log-Koordinaten, sobald die Sperre erworben worden, und Sperre wird dann sofort freigegeben.

Syntax:

mysqldump -u username -p password –all-databases –single-transaction > dump.sql mysqldump-u username-p Passwort-all-Datenbanken-single-transaction> dump.sql

How to Restore and Import MySQL Database Wie wiederherstellen und MySQL-Datenbank importieren

You can restore from phpMyAdmin, using Import tab. Sie können von phpMyAdmin, durch Importieren ". For faster way, upload the dump file to the MySQL server, and use the following command to import the databases back into the MySQL server. Für schnellere Weg, die Upload-Dump-Datei mit dem MySQL-Server, und verwenden Sie den folgenden Befehl zum Importieren der Datenbanken zurück in den MySQL-Server.

mysql -u username -p password database_name < dump.sql mysql-u username-p Passwort database_name <dump.sql

The import and export of MySQL database not only is important to recover the data when disaster strikes, but also provides an easy way to migrate or move to another server, such as when switching web hosting providers. Die Import-und Export von MySQL-Datenbank ist nicht nur wichtig, um die Daten bei Katastrophen, sondern bietet auch einen einfachen Weg zu migrieren oder verschieben auf einen anderen Server, wie beispielsweise beim Schalten Web Hosting Provider. However, do note that one common problem - character set encoding. Hingegen zögern Sie nicht, dass ein gemeinsames Problem - Zeichensatz-Codierung. Newer release of mysqldump uses UTF8 as its default charset if nothing is specified, while older versions (older than 4.1 typically) use Latin1 as default characterset. Neuere Version von mysqldump benutzt UTF8 als Standard-Zeichensatz, wenn nichts angegeben wird, während ältere Versionen (älter als typisch 4,1) für die Nutzung Latin1 als Standard-Zeichensatz. If you database charset is Latin1 and dump in UTF8 collation, the data may ends up become simply rubbish, garbled, or unreadable (frequently happen with Wordpress blog). Wenn Sie Datenbank-Zeichensatz ist latin1 und Dump in UTF8 Sortierung können die Daten bis zum Ende einfach Müll, verstümmelt oder unlesbar (häufig geschieht mit Wordpress Blog). If this case, use –default-character-set=charset_name option to specify the character set or Wenn dieser Fall, verwenden Sie-default-character-set = charset_name Option, um den Zeichensatz oder convert the database to UTF8 konvertieren die Datenbank auf UTF8 .

IMPORTANT : This is a machine translated page which is provided "as is" without warranty. WICHTIG: Es handelt sich um eine Maschine der Seite übersetzt wird "as is" ohne Garantie. Machine translation may be difficult to understand. Maschinelle Übersetzung ist vielleicht schwierig zu verstehen. Please refer to Bitte wenden Sie sich an original English article Original Englisch Artikel whenever possible. wann immer dies möglich ist.

Share and contribute or get technical support and help at Aktie und einen Beitrag oder erhalten technische Unterstützung und Hilfe an My Digital Life Forums Meine digitalen Lebens Foren .



9 Responses to “How to Backup and Restore (Export and Import) MySQL Databases Tutorial” 9 Responses to "How to Backup und Restore (Export und Import) Datenbanken MySQL Tutorial"

  1. johnrobin
    January 26th, 2008 01:32 26. Januar 2008 01:32
    1

    Nice post.. Post-Nizza .. I usually just copy the files.. Ich normalerweise nur kopieren Sie die Dateien .. for temporary.. für die vorübergehende .. and get all mysql queries for permanent backup.. und erhalten Sie alle MySQL-Abfragen für die endgültige Sicherung ..

  2. ferensick
    February 4th, 2008 12:48 4. Februar 2008 12:48
    2

    It shows how to backup all-databases… but how to restore all of them at once from the same file? Es zeigt, wie man alle Backup-Datenbanken… aber wie zur Wiederherstellung aller von ihnen auf einmal von der gleichen Datei? … I tried restoring the same way but receive a msg: unknown database: all-databases (I’ve done it before but I forget, it’s been a while… I’ll keep looking around) … Ich habe versucht die Wiederherstellung der gleichen Art und Weise, sondern erhalten eine msg: unbekannt Datenbank: All-Datenbanken (ich habe es geschafft, bevor ich aber vergessen, es hat sich eine Weile… Ich werde sie alle umschauen)

  3. ferensick
    February 4th, 2008 13:17 4. Februar 2008 13:17
    3

    mysql -u root -p < all-databases.sql mysql-u root-p <Alle-databases.sql
    done. getan. :-)

  4. tc
    February 6th, 2008 03:43 6. Februar 2008 03:43
    4

    mysqldump worked. mysqldump arbeitete.

    But ‘mysql’ to import data did not. Aber "mysql" zu importieren Daten nicht. The error is: Die Fehlermeldung lautet:
    ERROR at line 1: Unknown command ‘\m’ FEHLER in Zeile 1: Unknown command '\ m'

    any ideas? irgendwelche Ideen?

  5. Mohammod Nizam Uddin Mohammod Nizam Uddin
    February 16th, 2008 02:46 16. Februar 2008 02:46
    5

    thanks alot .. vielen Dank .. you saved my time and money both .. Sie gespeichert meine Zeit und Geld beide .. hat off to you . Hut ab für Sie.

  6. peanut Erdnuß
    April 14th, 2008 16:31 14. April 2008 16:31
    6

    Good post. Gute Post. But you can add some advanced tips to it, to make it better. Aber können Sie einige weiterführende Hinweise darauf, dass es besser machen. Goog luck! GOOG Glück!

  7. tarot
    May 27th, 2008 23:45 27. Mai 2008 23:45
    7

    Good post, but what about backing up the mysql users them selves? Gute Post, aber was ist das Sichern der MySQL-Benutzern ihnen selbst?

  8. Importar datos de MySQL de latin1 a UTF8 « Yvoictra Blog Zu importierenden Daten de MySQL de latin1 ein UTF8 «Yvoictra Blog
    July 21st, 2008 07:57 21. Jul 2008 07:57
    8

    [...] Enlace [...] Enlace [...] [...]

  9. danielix
    September 4th, 2008 17:24 4. September 2008 17:24
    9

    ciao sto cercando di effettuare il backup in locale su vista e iis 7.0 ciao sto cercando di effettuare il locale Backup in su vista e iis 7,0

    eseguo questo file php eseguo questo PHP-Datei

    db.sql

    ?>

    ma mi restituisce il seguente errore ma mi restituisce il seguente errore

    Parse error: syntax error, unexpected T_DEC in C:\inetpub\wwwroot\back.php on line 2 Parse error: syntax error, unexpected T_DEC in C: \ inetpub \ wwwroot \ back.php on line 2

    qualche consiglio? qualche Consiglio?

    grazie, daniele. Grazie, Daniele.

Leave a Reply Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> Sie können diese Tags: <a href= title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime = ""> <em> <i> <q Cite=""> <strike> <strong>

Subscribe without commenting Abonnieren ohne zu kommentieren


Custom Search

New Articles Neue Artikel

Incoming Search Terms for the Article Eingehender Suchbegriffe für den Artikel

mysqldump restore mysqldump wiederherstellen - -- mysqldump import mysqldump importieren - -- mysqldump utf8 mysqldump utf8 - -- mysqldump encoding mysqldump-Codierung - -- mysql export database MySQL-Datenbank exportieren - -- mysqldump tutorial mysqldump Tutorial - -- mysql export MySQL-Export - -- mysqldump syntax mysqldump Syntax - -- mysql export utf8 MySQL exportieren utf8 - -- mysql export syntax MySQL exportieren Syntax - -- mysqldump recover mysqldump erholen - -- mySQL import dump MySQL Import-Dump - -- mysql import utf8 MySQL Import utf8 - -- mysql import charset MySQL Import charset - -- mysql import backup MySQL-Backup importieren - -- import mysqldump Import mysqldump - -- mysql export charset MySQL exportieren charset - -- phpmyadmin export encoding phpMyAdmin Export-Codierung - -- mysqldump slow mysqldump langsam - -- mysql import syntax MySQL Import Syntax - -- phpmyadmin export utf8 phpMyAdmin Export utf8 - -- mysqldump example mysqldump Beispiel - -- mysqldump restore windows mysqldump Wiederherstellung von Windows - -- mysql export dump MySQL-Dump exportieren - -- export mysql Export MySQL - -- phpMyAdmin export charset phpMyAdmin Export charset - -- mysql import all databases MySQL Import aller Datenbanken - -- mirakagi tutorial mirakagi Tutorial - -- restore mysqldump Wiederherstellung mysqldump - -- mysql export encoding MySQL-Export-Codierung - -- all alle - -- phpmyadmin export tutorial phpMyAdmin Export-Tutorial - -- mysql import encoding MySQL Import-Codierung - -- mysql restore utf8 MySQL wieder utf8 - -- mysql import MySQL Import - -- mysql import slow MySQL Import langsam - -- phpmyadmin export utf-8 phpMyAdmin Export UTF-8 - -- export mysql database Export MySQL-Datenbank - -- import mysql database MySQL-Datenbank importieren - -- mysql import collation MySQL Import Sortierung - -- mysql import database MySQL Datenbank importieren - -- mysql import all-databases MySQL Import-Datenbanken - -- import mysql MySQL importieren - -- mysqldump utf-8 mysqldump UTF-8 - -- mysqldump syntax import mysqldump Syntax importieren - -- mysqldump restore example mysqldump Wiederherstellung Beispiel - -- mysql export table MySQL-Tabelle exportieren - -- mysqldump utf mysqldump UTF - -- restore data from mysqldump Wiederherstellen von Daten aus mysqldump - -- import mysql backup MySQL-Backup importieren - -- mysql export utf-8 MySQL exportieren UTF-8 - -- mysql import database dump MySQL Datenbank-Dump importieren - -- mysqldump import all databases mysqldump Import aller Datenbanken - -- import mysql dump MySQL-Dump importieren - -- mysql export innodb MySQL InnoDB-Export - -- mysql restore charset MySQL Wiederherstellung charset - -- mysqldump import export mysqldump Einfuhr Ausfuhr - -- mysqldump restore data mysqldump Wiederherstellen von Daten - -- mysqldump restore table mysqldump RESTORE TABLE - -- mysql export import MySQL Ausfuhr Einfuhr - -- import database dump Import-Datenbank-Dump - -- mysql import character set MySQL Import-Zeichensatz - -- restore mysqldump windows Wiederherstellung mysqldump Windows - -- mysql restore MySQL wiederherstellen - -- phpmyadmin export phpMyAdmin exportieren - -- mysql import dump charset MySQL-Dump importieren charset - -- import mysqldump file mysqldump-Datei importieren - -- mysqldump export table mysqldump Tabelle exportieren - -- phpmyadmin export latin1 phpMyAdmin Export latin1 - -- restore mysql dump ssh MySQL-Dump wiederherstellen SSH - -- mysql restore all databases MySQL Wiederherstellung aller Datenbanken - -- mysql export tutorial Export MySQL Tutorial - -- phpmyadmin export character set phpMyAdmin Export-Zeichensatz - -- mysql import mysqldump MySQL Import mysqldump - -- mysqldump examples mysqldump Beispiele - --