Mysql user creation script

后端 未结 7 675
猫巷女王i
猫巷女王i 2021-02-02 10:00

I\'m trying to automate MySQL user creation procedure. I thought of creating a temp file that would contain mysql user creation statements, then I would have call it like this :

7条回答
  •  别那么骄傲
    2021-02-02 10:11

    If you do not want to store password in clear text, then save it in hashed format -

    GRANT ALL PRIVILEGES ON mytestdatabase.* TO 'mytestdatabase'@'localhost'
      IDENTIFIED BY PASSWORD '*7560636C2922C05954FE6A2446AA00C84708B57B';
    

    Where hashed password is a result of this query -

    SELECT PASSWORD('my password');
    

提交回复
热议问题