Amazon Auroraの中身をちょっと覗いてみる


ブログの会社がすでにやってそうだけど、自分の覚書も兼ねて記事にしておく。

##バージョン確認
        mysql> status
        --------------
        mysql  Ver 14.14 Distrib 5.6.16-64.1, for Linux (x86_64) using  EditLine wrapper

        Connection id:          XXXXXX
        Current database:       mysql
        Current user:           wp_database@XXX.XX.XX.XX
        SSL:                    Not in use
        Current pager:          stdout
        Using outfile:          ''
        Using delimiter:        ;
        Server version:         5.6.10 MySQL Community Server (GPL)
        Protocol version:       10
        Connection:             wp-aurora.cluster-XXXXXXXXXXX.ap-northeast-1.rds.amazonaws.com via TCP/IP
        Server characterset:    latin1
        Db     characterset:    latin1
        Client characterset:    utf8
        Conn.  characterset:    utf8
        TCP port:               3306
        Uptime:                 19 days 2 hours 8 min 3 sec

        Threads: 5  Questions: 12269724  Slow queries: 38  Opens: 9787  Flush tables: 1  Open tables: 8646  Queries per second avg: 7.439
        --------------
        
##ユーザー追加
MySQL互換、というかstatus見る限りMySQL5.6.10が入ってるっぽいのでそのままSQLを打ち込んで行こう。

	mysql > use mysql;
	mysql > CREATE USER 'test'@'localhost' IDENTIFIED BY 'password';
	
##ついでにmysqlDBの中身をざっと見
        mysql> show tables;
        +-------------------------------+
        | Tables_in_mysql               |
        +-------------------------------+
        | bin_log_md_table              |
        | bin_log_table                 |
        | columns_priv                  |
        | db                            |
        | ddl_log_md_table              |
        | ddl_log_table                 |
        | event                         |
        | func                          |
        | general_log                   |
        | help_category                 |
        | help_keyword                  |
        | help_relation                 |
        | help_topic                    |
        | innodb_index_stats            |
        | innodb_table_stats            |
        | metadata_md_table             |
        | metadata_table                |
        | ndb_binlog_index              |
        | plugin                        |
        | proc                          |
        | procs_priv                    |
        | proxies_priv                  |
        | rds_configuration             |
        | rds_global_status_history     |
        | rds_global_status_history_old |
        | rds_heartbeat2                |
        | rds_history                   |
        | rds_replication_status        |
        | rds_sysinfo                   |
        | relay_log_md_table            |
        | relay_log_table               |
        | ro_replica_status             |
        | servers                       |
        | slave_master_info             |
        | slave_relay_log_info          |
        | slave_worker_info             |
        | slow_log                      |
        | tables_priv                   |
        | time_zone                     |
        | time_zone_leap_second         |
        | time_zone_name                |
        | time_zone_transition          |
        | time_zone_transition_type     |
        | user                          |
        +-------------------------------+
        44 rows in set (0.00 sec)
        
##ユーザーテーブルのカラムを見てみる

        mysql> show columns from user;
        +------------------------+-----------------------------------+------+-----+---------+-------+
        | Field                  | Type                              | Null | Key | Default | Extra |
        +------------------------+-----------------------------------+------+-----+---------+-------+
        | Host                   | char(60)                          | NO   | PRI |         |       |
        | User                   | char(16)                          | NO   | PRI |         |       |
        | Password               | char(41)                          | NO   |     |         |       |
        | Select_priv            | enum('N','Y')                     | NO   |     | N       |       |
        | Insert_priv            | enum('N','Y')                     | NO   |     | N       |       |
        | Update_priv            | enum('N','Y')                     | NO   |     | N       |       |
        | Delete_priv            | enum('N','Y')                     | NO   |     | N       |       |
        | Create_priv            | enum('N','Y')                     | NO   |     | N       |       |
        | Drop_priv              | enum('N','Y')                     | NO   |     | N       |       |
        | Reload_priv            | enum('N','Y')                     | NO   |     | N       |       |
        | Shutdown_priv          | enum('N','Y')                     | NO   |     | N       |       |
        | Process_priv           | enum('N','Y')                     | NO   |     | N       |       |
        | File_priv              | enum('N','Y')                     | NO   |     | N       |       |
        | Grant_priv             | enum('N','Y')                     | NO   |     | N       |       |
        | References_priv        | enum('N','Y')                     | NO   |     | N       |       |
        | Index_priv             | enum('N','Y')                     | NO   |     | N       |       |
        | Alter_priv             | enum('N','Y')                     | NO   |     | N       |       |
        | Show_db_priv           | enum('N','Y')                     | NO   |     | N       |       |
        | Super_priv             | enum('N','Y')                     | NO   |     | N       |       |
        | Create_tmp_table_priv  | enum('N','Y')                     | NO   |     | N       |       |
        | Lock_tables_priv       | enum('N','Y')                     | NO   |     | N       |       |
        | Execute_priv           | enum('N','Y')                     | NO   |     | N       |       |
        | Repl_slave_priv        | enum('N','Y')                     | NO   |     | N       |       |
        | Repl_client_priv       | enum('N','Y')                     | NO   |     | N       |       |
        | Create_view_priv       | enum('N','Y')                     | NO   |     | N       |       |
        | Show_view_priv         | enum('N','Y')                     | NO   |     | N       |       |
        | Create_routine_priv    | enum('N','Y')                     | NO   |     | N       |       |
        | Alter_routine_priv     | enum('N','Y')                     | NO   |     | N       |       |
        | Create_user_priv       | enum('N','Y')                     | NO   |     | N       |       |
        | Event_priv             | enum('N','Y')                     | NO   |     | N       |       |
        | Trigger_priv           | enum('N','Y')                     | NO   |     | N       |       |
        | Create_tablespace_priv | enum('N','Y')                     | NO   |     | N       |       |
        | ssl_type               | enum('','ANY','X509','SPECIFIED') | NO   |     |         |       |
        | ssl_cipher             | blob                              | NO   |     | NULL    |       |
        | x509_issuer            | blob                              | NO   |     | NULL    |       |
        | x509_subject           | blob                              | NO   |     | NULL    |       |
        | max_questions          | int(11) unsigned                  | NO   |     | 0       |       |
        | max_updates            | int(11) unsigned                  | NO   |     | 0       |       |
        | max_connections        | int(11) unsigned                  | NO   |     | 0       |       |
        | max_user_connections   | int(11) unsigned                  | NO   |     | 0       |       |
        | plugin                 | char(64)                          | YES  |     |         |       |
        | authentication_string  | text                              | YES  |     | NULL    |       |
        | password_expired       | enum('N','Y')                     | NO   |     | N       |       |
        +------------------------+-----------------------------------+------+-----+---------+-------+
        43 rows in set (0.00 sec)