mysql新しいユーザーを作成するコマンド

750 ワード

//ユーザーの作成(ユーザー名:minパスワード:123)
mysql> insert into mysql.user(Host,User,Password)
values("localhost","min",password("123"));

//システム権限表の更新
mysql>flush privileges;

//minユーザーにtreeデータベースのすべての権限を持つことを許可する
mysq>grant all privileges on tree.* to min@localhost identified by '123';

//ユーザーの削除
mysql>DELETE FROM user WHERE User="min" and Host="localhost";

//ユーザーパスワードの変更
mysql>update mysql.user set password=password('123456') 
where User="min" and Host="localhost";