[MySQL]
  • 起動方法
mysql -u username -h hostname -P portnum -D databasename -p

  • dump
mysqldump -u testuser -p testdb > export.sql

  • restore
create database newdb;
mysql -u root -p newdb < export.sql

  • ユーザ追加
grant all on newdb.* to testuser@localhost identified by 'password';

  • ページャー設定
pager less -n -i -S

  • 縦表示
show table status\G

  • ステータス
show table status;

  • プロセス
show processlist;

  • テーブルスキーマ
desc tablename;

  • 各テーブルのスキーマ
select * from information_schema.TABLES where TABLE_SCHEMA = 'nomura';

select table_name,table_rows from information_schema.TABLES;
最終更新:2017年06月06日 00:14