mysql久々にいじったらコマンド完全に忘れていたのでメモ。
ルートでログイン。パスワート要入力。
$mysql -u root -p
データベース名リストアップ
mysql>show databases;
テーブル名リストアップ
mysql>use {データベース名}; mysql>show tables;
OSXでbrewでmysqlをインストールした後、mysqlサービスを立ち上げるコマンド
~$ mysql.server start
OSXでbrewでmysqlをインストールした後にログインする方法
~$ mysql -u root
mysql内のユーザー作成
mysql> create user '{ユーザー名}'@'localhost' identified by '{パスワード}';
ユーザーにdatabase create権限を与える
grant all on *.* to '{ユーザー名}'@'localhost';
ユーザーの状態の確認
select user, host, password, plugin from mysql.user;