MySQL: Grant **all** privileges on database

后端 未结 11 1209
庸人自扰
庸人自扰 2020-11-22 09:23

I\'ve created database, for example \'mydb\'.

CREATE DATABASE mydb CHARACTER SET utf8 COLLATE utf8_bin;
CREATE USER \'myuser\'@\'%\' IDENTIFIED BY PASSWORD          


        
11条回答
  •  -上瘾入骨i
    2020-11-22 10:18

    To access from remote server to mydb database only

    GRANT ALL PRIVILEGES ON mydb.* TO 'root'@'192.168.2.21';
    

    To access from remote server to all databases.

    GRANT ALL PRIVILEGES ON * . * TO 'root'@'192.168.2.21';
    

提交回复
热议问题