版本5.7

  CREATE DATABASE    `databasename`;
       CREATE USER 'username'@'%' IDENTIFIED BY 'password';
       GRANT ALL PRIVILEGES ON `databasename`.* TO 'username'@'%' IDENTIFIED BY 'password';
       FLUSH PRIVILEGES;

  

版本8.0

  CREATE DATABASE    `databasename`;
       CREATE USER 'username'@'%' IDENTIFIED BY 'password';
       GRANT ALL PRIVILEGES ON `databasename`.* TO 'username'@'%' WITH GRANT OPTION;
       FLUSH PRIVILEGES;

posted on 2022-08-24 10:15  vofill-work  阅读(71)  评论(0编辑  收藏  举报