回覆列表
  • 1 # 使用者566706995143

    mysql 建立一個使用者 hail,密碼 hail,指定一個數據庫 haildb 給 hail

    mysql -u root -p

    password

    use mysql;

    insert into user(host,user,password) values("localhost","hail",password("hail"));

    flush privileges;

    create database haildb;

    grant all privileges on haildb.* to hail@localhost identified by "hail";

    flush privileges;

    如果想指定部分許可權給使用者

    grant select,update on haildb.* to hail@localhost identified by "hail";

    flush privileges;

    delete from user where user="hail" and host="localhost";

    flush privileges;

    drop database haildb;

    修改指定使用者密碼

    update user set password=password("new_password") where user="hail" and host="localhost";

    flush privileges;

  • 中秋節和大豐收的關聯?
  • 犬夜叉簡介?