This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nohup mysql -u <username> -p --max_allowed_packet=12000M <db_name> < <file_path> & |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
table_schema as `Database`, | |
table_name AS `Table`, | |
round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB` | |
FROM information_schema.TABLES | |
ORDER BY (data_length + index_length) DESC; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql> show full processlist\G; | |
*************************** 6. row *************************** | |
Id: <接続識別子、これは、INFORMATION_SCHEMA.PROCESSLIST テーブルの ID カラムの値> | |
User: <発行したMySQLユーザー> | |
Host: <発行しているクライエントのホスト名> | |
db: <データベース名> | |
Command: <コメンド種類:Query, Connect, Sleep等>。クエリの場合、Queryになる | |
Time: <現在の状態どれだけ続いている(数秒)> | |
State: <コメンドの状態:Sending data等> | |
Info: <クエリ文> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE `article_test` ( | |
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, | |
`title` varchar(255) DEFAULT NULL COMMENT 'タイトル', | |
`content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '本文', | |
PRIMARY KEY (`id`), | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 |