0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

レンタルサーバー仕様をオーバーする重いSQLファイルをインポートする方法

0
Last updated at Posted at 2026-10-30

413 Request Entity Too Large

さくらレンタルサーバーに重いSQL復元できない時、PhpMyAdminではインポートできない

必要なデータ

SQLファイル
データベースユーザー名
データベースサーバー名
データベース名
データベースパスワード

インポート先

データベースのインポート

インポート先にデータが有ればバックアップする
インポートする先のデータベースのすべてのテーブルを空にする

テーブルのインポート

インポート先にデータが有ればバックアップする
インポートする先のテーブルのすべてのデータを空にする

FTPでサーバーの任意の場所に重いSQLをアップロード

/home/ユーザー名/www/この辺りでよい

SSHでインポート

mysql -h DBホスト名 -u DBユーザー名 -p --default-character-set=utf8mb4 DB名 < ファイル.sql 2> import_error.log
Enter password:パスワード入力

進捗の確認

pv ファイル.sql | mysql -h DBホスト名 -u DBユーザー名 -p --default-character-set=utf8mb4 DB名

ログの確認

cat import_error.log
SELECT table_name, table_rows FROM information_schema.tables WHERE table_schema = 'DB名' ORDER BY table_name;

PhpMyAdminで確認

0
0
0

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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?