MySQL: Grant **all** privileges on database

后端 未结 11 1194
庸人自扰
庸人自扰 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条回答
  •  渐次进展
    2020-11-22 10:01

    This SQL grants on all databases but just basic privileges. They're enough for Drupal or Wordpress and as a nicety, allows one developer account for local projects.

    GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, 
        INDEX, ALTER, CREATE TEMPORARY TABLES 
    ON *.* TO 'username'@'localhost' IDENTIFIED BY 'password';
    

提交回复
热议问题