How to Backup and Restore (Export and Import) MySQL Databases Tutorialどのようにバックアップと復元(エクスポートおよびインポート) MySQLデータベースのチュートリアル

phpMyAdmin can be used to export or backup MySQL databases easily. phpMyAdminのエクスポートまたはバックアップを使用してMySQLデータベースを簡単にします。 However, if the database size is very big, it probably won’t be a good idea.しかし、もし、データベースのサイズが非常に大きいため、おそらく良いアイデアはできません。 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のダンプにより、ユーザーはデータベースを保存するファイルまたはディスプレイを画面に表示するとして、これは、 SQLステートメントは、サーバーからエクスポートし、全体のデータ転送遅いネットワーク接続またはインターネットをユーザーのコンピュータです。 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.このプロセスをゆっくりと、輸出のプロセスは、データベースのロックを増やすための時間とMySQLの使い勝手の悪さ、接続速度が遅いことは、単にクラッシュ、サーバーとサーバーは、 Apacheのhttpdの数が多すぎます着信方向のWeb接続の場合、システムのリソース以上にとる。

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.ののより良い方法をMySQLデータベースのバックアップおよびエクスポートを行うと、タスクは、サーバー上のローカルに、して、テーブルのデータが即座にダンプするには、ローカルディスクに遅延が発生します。 Thus export speed will be faster and reduce the time MySQL database or table is locked for accessing.このように輸出速度が速いとの時間を削減するMySQLデータベースへのアクセスまたはテーブルがロックされています。 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.このチュートリアルでは、ガイドをする方法をバックアップ(エクスポート)と復元(インポート) mysqlデータベース(劇団)には、データベースサーバー自体を使用して、 mysqldumpおよびMySQLのユーティリティです。 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.基本的に2つのメソッドをバックアップするには、 MySQLでは、 1つはすべてのテーブルをコピーファイル( *. frm 、 *. myd 、および、 *. myiファイル)またはmysqlhotcopyはユーティリティを使用して、それMyISAMテーブルでのみ動作します。 Below tutorial will concentrate on mysqldump which works for both MyISAM and InnoDB tables. mysqldumpを以下のチュートリアルでは、どの作品に集中するMyISAMとInnoDBテーブルの両方です。

How to Export or Backup or Dump A MySQL Database どのようにエクスポートする、またはバックアップまたはダンプをMySQLのデータベースに

To export a MySQL database into a dump file, simply type the following command syntax in the shell. MySQLのデータベースをエクスポートするにダンプファイルを、単にタイプは、次のコマンドの構文は、シェルです。 You can use Telnet or SSH to remotely login to the machine if you don’t have access to the physical box. Telnetやsshを使用することができますリモートログインするには、マシンのアクセスをお持ちでない場合は、物理的なボックスをオンします。

mysqldump -u username -p password database_name > dump.sqlのmysqldump - u ユーザ名 - p パスワード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. ユーザー名に置き換える有効なMySQLユーザID 、 パスワード 、ユーザーのパスワードを有効にする(重要:いいえスペース- pとパスワードをした後、他のmysqldumpはパスワードのプロンプトが表示さはまだありませんが、パスワードとしてデータベース名を扱うので、バックアップが失敗)とdatabase_nameに 、データベース内の実際の名前をエクスポートするしたいです。 Finally, you can put whatever name you like for the output SQL dump file, here been dump.sql .最後に、どんな名前に置くことができるようにするためのSQLダンプファイルの出力、ここ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.の中のデータ、テーブル、データベースの構造とdatabase_nameにバックアップされるテキストファイルの名前を、 SQL dump.sqlに、上記のコマンドを実行します。

How to Export A MySQL Database Structures Only MySQLデータベースの構造をエクスポートする方法のみ

If you no longer need the data inside the database’s tables (unlikely), simply add –no-data switch to export only the tables’ structures.もはや必要とする場合、データベースのテーブル内のデータ(思いも寄らない) 、スイッチを追加するだけのデータをエクスポートするは、テーブルの構造です。 For example, the syntax is:たとえば、この構文は:

mysqldump -u username -p password –no-data database_name > dump.sqlのmysqldump - u ユーザ名 - p パスワード -ない-データdatabase_nameに > dump.sql

How to Backup Only Data of a MySQL Database のみのデータをバックアップする方法を、 MySQLデータベースに

If you only want the data to be backed up, use –no-create-info option.手続きのみを行いたい場合に、データをバックアップの作成-に関する情報を使用するオプションを選択します。 With this setting, the dump will not re-create the database, tables, fields, and other structures when importing.この設定では、ダンプされるわけではございません、データベースを作成し、テーブル、フィールド、およびその他の構造のインポート時です。 Use this only if you pretty sure that you have a duplicate databases with same structure, where you only need to refresh the data.この場合にのみ使用を確認してくださいかなりのデータベースと同じ構造を複製するには、ここでデータをリフレッシュするにのみが必要です。

mysqldump -u username -p password –no-create-info database_name > dump.sqlのmysqldump - u ユーザ名 - p パスワードの作成-に関する情報をdatabase_nameに > dump.sql

How to Dump Several MySQL Databases into Text File MySQLデータベースをダンプする方法をいくつかのテキストファイル

–databases option allows you to specify more than 1 database. - databasesオプションを使用すると1を超えるデータベースを指定します。 Example syntax:例構文:

mysqldump -u username -p password –databases db_name1 [db_name2 ...] > dump.sqlのmysqldump - u ユーザ名 - p パスワード -データベースdb_name1 [ db_name2 ... ] > dump.sql

How to Dump All Databases in MySQL Server どのようMySQLサーバのすべてのデータベースをダンプする

To dump all databases, use the –all-databases option, and no databases’ name need to be specified anymore.すべてのデータベースをダンプする、 - all - databasesオプションを使用して、データベースとの'の名前を指定する必要はない。

mysqldump -u username -p password –all-databases > dump.sqlのmysqldump - u ユーザ名 - p パスワード -すべて-データベース> dump.sql

How to Online Backup InnoDB Tables InnoDBテーブルのオンラインバックアップする方法を

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.避けられない原因MySQLサーバのデータベースのバックアップをアプリケーションに使用できないため、エクスポート時に、グローバルな読み取りロックを取得するすべてのテーブルをフラッシュを使用してテーブルを読み取りロックされるまでの冒頭には、ダンプを完了します。 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.これを読むのステートメントを続行するものの、すべての挿入、更新、および削除ステートメントを待ち行列にはテーブルロックのために、 MySQLがダウンしているか暗礁に乗り上げている場合です。 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. InnoDBテーブルを使用する場合は、 - 1つのトランザクションは、このロック時間を最小限に抑えるための方法を体のほぼ存在しない期間としてオンラインバックアップを実行する場合です。 It works by reading the binary log coordinates as soon as the lock has been acquired, and lock is then immediately released.それの作品を読んで、バイナリログの座標をロックされ次第、すぐに取得した、とロックは、その後すぐにリリースされました。

Syntax:構文:

mysqldump -u username -p password –all-databases –single-transaction > dump.sqlのmysqldump - u ユーザ名 - p パスワード -すべて-データベース- 1つのトランザクション> dump.sql

How to Restore and Import MySQL Database mysqlデータベースを復元する方法およびインポート

You can restore from phpMyAdmin, using Import tab. PHPMyAdminに復元することができますから、使用してインポートタブをクリックします。 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.高速道、ダンプファイルをアップロードして、 MySQLサーバ、および以下のコマンドを使用してデータベースにインポートしてMySQLサーバに戻される。

mysql -u username -p password database_name < dump.sql MySQLの- u ユーザ名 - p パスワード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. MySQLのデータベースのインポートおよびエクスポートが重要なだけでなく、災害時のデータを回復する、簡単な方法を提供するだけでなく、または移動を別のサーバーに移行するなど、ウェブホスティングプロバイダをスイッチングするときです。 However, do note that one common problem - character set encoding.しかし、それに注意して1つの共通の問題-文字セットのエンコーディングです。 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. mysqldumpを使用して新しいリリースにutf8として、デフォルトのcharset指定がない場合は、古いバージョン( 4.1以上、通常)としてlatin1のデフォルトの文字セットを使用します。 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).データベースのcharsetがlatin1とする場合にutf8ダンプの照合順序は、 5月のデータになるだけで終わる酷い、文字化けするか、または読み取れない(頻繁に起こるとWordPressのブログ) 。 If this case, use –default-character-set=charset_name option to specify the character set orもしこの場合、 デフォルトの文字セットを使用= charset_nameのオプションを指定して文字セットや convert the database to UTF8データベースをutf8に変換して .です。

IMPORTANT : This is a machine translated page which is provided "as is" without warranty. 重要 :これは、機械翻訳ページで提供"現状有姿"を保証します。 Machine translation may be difficult to understand.機械翻訳を理解するのは難しいかもしれません。 Please refer toを参照してください original English articleオリジナルの英語記事索引 whenever possible.いつ可能です。

Share and contribute or get technical support and help atを共有して貢献や技術サポートとヘルプを得る My Digital Life Forums 私のデジタルライフフォーラム .です。



8 Responses to “How to Backup and Restore (Export and Import) MySQL Databases Tutorial” 8つの応答を"どのようにバックアップと復元(エクスポートおよびインポート) MySQLデータベースチュートリアル"

  1. johnrobin
    January 26th, 2008 01:32 2008年1月26日01:32
    1

    Nice post..ニースの投稿.. I usually just copy the files..私は通常のファイルだけをコピーする.. for temporary..一時.. and get all mysql queries for permanent backup..とすべてのMySQLのクエリを得る恒久的なバックアップ..

  2. ferensick
    February 4th, 2008 12:48 2008年2月4日12:48
    2

    It shows how to backup all-databases… but how to restore all of them at once from the same file?それをすべてのデータベースをバックアップする方法を示して…しかし、それらを復元する方法についてのすべてのファイルを一度により、同じですか? … 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) …同じように復元してみましたが受信するメッセージ:不明なデータベース:全てのデータベース(私は前にやったことしかし、私は忘れて、それはしばらく見ている…覚えておきます)

  3. ferensick
    February 4th, 2008 13:17 2008年2月4日13:17
    3 4

    mysql -u root -p < all-databases.sqlルートのMySQL - u - p <全databases.sql
    done.完了した。 :-)

  4. tc
    February 6th, 2008 03:43 2008年2月6日03:43
    4

    mysqldump worked. mysqldumpを働いています。

    But ‘mysql’ to import data did not.しかし、 ' MySQLの'データをインポートするしなかった。 The error is:このエラーは:
    ERROR at line 1: Unknown command ‘\m’ 1行でエラーが発生:不明なコマンド' \ M 'の

    any ideas?何かお考えですか?

  5. Mohammod Nizam Uddin mohammodニザームuddin
    February 16th, 2008 02:46 2008年2月16日02:46
    5

    thanks alot ..どうもありがとう.. you saved my time and money both ..私の時間とお金の両方を保存.. hat off to you .帽子をオフにします。

  6. peanutピーナッツ
    April 14th, 2008 16:31 2008年4月14日16:31
    6

    Good post.良いポストを作成。 But you can add some advanced tips to it, to make it better.しかし、いくつかの高度なヒントを追加することもできますし、しております。 Goog luck! 6758幸運!

  7. tarotタロット
    May 27th, 2008 23:45 2008年5月27日23:45
    7

    Good post, but what about backing up the mysql users them selves?良いポストは、しかし、どのようなMySQLのユーザーをバックアップすることについては自分ですか?

  8. Importar datos de MySQL de latin1 a UTF8 « Yvoictra BlogデータデMySQLのデlatin1のをimportarにutf8 « yvoictraブログ
    July 21st, 2008 07:57 2008年7月21日07:57
    8

    [...] Enlace [...] [...]リンク[...]

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> これらのタグを使用することができます: <aのhref=のtitle= <abbrのtitle= <blockquote cite=""> <cite> <acronymのtitle= <b>ダウンロードの<code> <デル日時= " " >の<em> <i>て<strike> <strong> <q cite="">

Subscribe without commenting登録なしのコメント


Custom Search

New Articles新しい記事

Incoming Search Terms for the Article検索用語を受信するには

mysqldump restore mysqldumpを復元 - - mysqldump import mysqldumpをインポートする - - mysqldump utf8 mysqldumpをUTF8に - - mysqldump encoding mysqldumpをエンコーディング - - mysql export database MySQLの輸出データベース - - mysqldump tutorial mysqldumpをチュートリアル - - mysql export MySQLのエクスポート - - mysqldump syntax mysqldumpを構文 - - mysql export utf8 MySQLの輸出にutf8 - - mysql export syntax MySQLの輸出構文 - - mysqldump recover mysqldumpを回復 - - mySQL import dump MySQLのインポートダンプ - - mysql import utf8 MySQLのインポートにutf8 - - mysql import charset MySQLのインポートのcharset - - mysql import backup MySQLのインポートバックアップ - - import mysqldump mysqldumpをインポートする - - mysql export charset MySQLの輸出のcharset - - phpmyadmin export encoding phpMyAdminの輸出符号化 - - mysqldump slow mysqldumpを遅らせる - - mysql import syntax MySQLのインポート構文 - - phpmyadmin export utf8 phpMyAdminの輸出にutf8 - - mysqldump example mysqldumpを例 - - mysqldump restore windows Windowsのmysqldumpを復元する - - mysql export dump MySQLのエクスポートダンプ - - export mysql 輸出のMySQL - - phpMyAdmin export charset phpMyAdminの輸出のcharset - - mysql import all databases すべてのデータベースMySQLのインポート - - mirakagi tutorial mirakagiチュートリアル - - restore mysqldump mysqldumpを復元する - - mysql export encoding MySQLの輸出符号化 - - all すべての - - phpmyadmin export tutorial phpMyAdminの輸出チュートリアル - - mysql import encoding MySQLのインポートのエンコーディング - - mysql restore utf8 MySQLの復元にutf8 - - mysql import MySQLのインポート - - mysql import slow MySQLのインポート遅い - - phpmyadmin export utf-8 UTF - 8でphpMyAdminのエクスポート - - export mysql database MySQLデータベースのエクスポート - - import mysql database MySQLデータベースにインポート - - mysql import collation MySQLのインポート照合順序 - - mysql import database MySQLのデータベースにインポートする - - mysql import all-databases すべてのMySQLデータベースにインポート - - import mysql MySQLのインポート - - mysqldump utf-8 mysqldumpをUTF - 8に - - mysqldump syntax import mysqldumpを構文をインポートする - - mysqldump restore example mysqldumpを復元する例 - - mysql export table MySQLのエクスポート]テーブル - - mysqldump utf mysqldumpをのUTF - - restore data from mysqldump mysqldumpをからデータを復元する - - import mysql backup MySQLのバックアップをインポートする - - mysql export utf-8 MySQLの輸出のUTF - 8 - - mysql import database dump MySQLのデータベースダンプのインポート - - mysqldump import all databases mysqldumpをインポートするすべてのデータベース - - import mysql dump MySQLのダンプをインポートする - - mysql export innodb InnoDBのMySQLのエクスポート - - mysql restore charset MySQLの復元のcharset - - mysqldump import export mysqldumpをインポートエクスポート - - mysqldump restore data mysqldumpを復元するデータ - - mysqldump restore table mysqldumpを復元テーブル - - mysql export import MySQLのエクスポートインポートする - - import database dump インポートするデータベースダンプ - - mysql import character set MySQLの文字セットをインポートする - - restore mysqldump windows mysqldumpをWindowsの復元 - - mysql restore MySQLの復元 - - phpmyadmin export phpMyAdminのエクスポート - - mysql import dump charset MySQLのインポートダンプのcharset - - import mysqldump file mysqldumpをファイルをインポートする - - mysqldump export table mysqldumpを輸出表 - - phpmyadmin export latin1 phpMyAdminの輸出latin1の - - restore mysql dump ssh MySQLのダンプの復元のSSH - - mysql restore all databases MySQLのすべてのデータベースを復元する - - mysql export tutorial MySQLの輸出チュートリアル - - phpmyadmin export character set phpMyAdminの輸出文字セット - - mysql import mysqldump mysqldumpをMySQLのインポート - - mysqldump examples mysqldumpを例 - -