1 まずはデフォルトユーザーであるrootでmysqlにログインする
mysql -u root
2 ログインできたら、mysqlのユーザ一覧でどんなユーザーがいるのか確認する
SELECT Host, User FROM mysql.user;
3 新しくユーザー作成する
grant all on データベース名.* to ユーザー名@接続元 identified by ‘パスワード’;
4 現在rootでログインしてるためexitでログアウトする
5 新規で作成したユーザーでログインする
mysql -u ユーザー名 -p