MySQLのコマンド備忘

MySQL
https://www.sasukepg.jp/post-1038/


ユーザの確認
SELECT host,user FROM mysql.user;


パスワードの変更
SET PASSWORD FOR usernonamae@"%"=PASSWORD('passwordmoji');


DBに接続
mysql -h test-xxxxxrds-yyyymmdd.xxxxxxxxxxxxxxx.ap-northeast-1.rds.amazonaws.com -u usernonamae -p dbnonamae


テーブルのカラム数を確認
select table_name, table_rows from information_schema.TABLES where table_schema = 'dbnonamae';


レコードの削除
select count(*) from where karamumei='';
delete from tablenonamae where karamumei='';