42
47

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

MySQL データベース移行手順

Last updated at Posted at 2015-09-14
  1. 移行元データベースからダンプを作成する

    mysqldump -h HOST_NAME -u USER_NAME -p DATABASE_NAME > DUMP_OUTPUT_FILE_PATH
    
  2. 移行先データベースを作成する

    1. 移行先データベースに接続
    mysql  -h OTHER_HOSTNAME -u USER_NAME -p
    
    1. データベースを作成(文字コードをお忘れなく!)
    create database DATABASE_NAME default character set utf8 default collate utf8_general_ci;
    
  3. 移行先データベースにダンプファイルの中身を読み込む

    mysql -h HOST_NAME -u USER_NAME -p DATABASE_NAME < DUMP_OUTPUT_FILE_PATH
    

参考URL

MySQL データベースのほかのマシンへのコピー(MySQL 5.6 リファレンスマニュアル)

42
47
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
42
47

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?