Mysql user creation script

后端 未结 7 670
猫巷女王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:25

    Take a look at the following url and this will help you to fix the issue:

    http://linuxadministrator.pro/blog/?p=147

    mysql> select password('12345');
    +-------------------------+
    | password('123456') |
    +-------------------------+
    | 2ff898e158cd0311        |
    +-------------------------+
    1 row in set (0.00 sec)
    
    mysql> create user test identified by password '2ff898e158cd0311';
    Query OK, 0 rows affected (0.00 sec)
    

提交回复
热议问题