mysql> SELECT VERSION(), CURRENT_DATE; +-----------+--------------+ | VERSION() | CURRENT_DATE | +-----------+--------------+ | 8.0.35 | 2023-11-15 | +-----------+--------------+ 1 row in set (0.00 sec)
select user, host from mysql.user; +------------------+-----------+ | user | host | +------------------+-----------+ | wordpress | % | | mysql.infoschema | localhost | | mysql.session | localhost | | mysql.sys | localhost | | root | localhost | +------------------+-----------+ 5 rows in set (0.00 sec)
mysql> select host,db,user from mysql.db; +-----------+--------------------+---------------+ | host | db | user | +-----------+--------------------+---------------+ | localhost | performance_schema | mysql.session | | localhost | sys | mysql.sys | +-----------+--------------------+---------------+ 2 rows in set (0.00 sec) mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | +--------------------+ 4 rows in set (0.00 sec)
mysql> show tables from sys; +-----------------------------------------------+ | Tables_in_sys | +-----------------------------------------------+ | host_summary | | host_summary_by_file_io | | host_summary_by_file_io_type | | host_summary_by_stages | | host_summary_by_statement_latency | | host_summary_by_statement_type | | innodb_buffer_stats_by_schema | | innodb_buffer_stats_by_table | | innodb_lock_waits | | io_by_thread_by_latency | | io_global_by_file_by_bytes | | io_global_by_file_by_latency | | io_global_by_wait_by_bytes | | io_global_by_wait_by_latency | | latest_file_io | | memory_by_host_by_current_bytes | … | x$wait_classes_global_by_avg_latency | | x$wait_classes_global_by_latency | | x$waits_by_host_by_latency | | x$waits_by_user_by_latency | | x$waits_global_by_latency | +-----------------------------------------------+ 101 rows in set (0.02 sec)
show create table <table名>
SHOW COLUMNS FROM <table>;
SHOW GRANTS FOR <user>@<host>;
SELECT LAST_INSERT_ID()
1. テーブルのクリエイト 2. 実行結果のカラム名全コピー 3. レコードの全コピー 4. 実行結果のCSV出力 5. 実行結果のクリア 6. Dump出力
$ sudo -e /etc/mysql/mysql.conf.d/mysqld.cnf #bind-address = 172.0.0.1 <コメントアウトする
ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password' cannot be loaded: /usr/lib64/mysql/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory
sudo chkconfig mysqld on