通过Shell脚本批量创建服务器上的MySQL数据库账号

2019-09-23 08:50:25王旭

Step 3 执行的具体命令(参数格式),例如 在 177.177.XXX.128,177.177.XXX.144 两个 3306的实例上创建账号

./mysql_CreateUIDMulti.sh 177.177.XXX.128,177.177.XXX.144 3306

Step 4 打印的执行结果如下

177.177.XXX.128,177.177.XXX.144
177.177.XXX.128
177.177.XXX.128
mysql: [Warning] Using a password on the command line interface can be insecure.
20180529171802 The Condition is OK,permit to create UID.
mysql: [Warning] Using a password on the command line interface can be insecure.
mysql: [Warning] Using a password on the command line interface can be insecure.
177.177.% testuid Y N N N N N N N Y N N N N N N N N N N N N N N N N N N N N 0 0 0 0 mysql_native_password *22CBF14EBDE8814586FF12332FA2B6023A7603BB N 2018-05-29 17:18:02 NULL N
20180529171802 177.177.XXX.128 Congratulation! Create UID successful
177.177.XXX.144
mysql: [Warning] Using a password on the command line interface can be insecure.
177.177.% testuid Y N N N N N N N Y N N N N N N N N N N N N N N N N N N N N 0 0 0 0 mysql_native_password *22CBF14EBDE8814586FF12332FA2B6023A7603BB N 2018-05-30 00:56:38 NULL N
20180529171802 177.177.XXX.144 The UID you want create has been exited, please check it! The Act Quit!

4.补充说明

如果创建一个服务器上的MySQL账号,可按照以下格式

./mysql_CreateUIDMulti.sh 177.177.XXX.128 3306

打印的Log 如下

177.177.XXX.128
177.177.XXX.128
177.177.XXX.128
mysql: [Warning] Using a password on the command line interface can be insecure.
20180529173517 The Condition is OK,permit to create UID.
mysql: [Warning] Using a password on the command line interface can be insecure.
mysql: [Warning] Using a password on the command line interface can be insecure.
177.177.% testuid Y N N N N N N N Y N N N N N N N N N N N N N N N N N N N N 0 0 0 0 mysql_native_password *22CBF14EBDE8814586FF12332FA2B6023A7603BB N 2018-07-29 17:35:17 NULL N
20180529173517 177.177.XXX.128 Congratulation! Create UID successful

总结

以上所述是小编给大家介绍的通过Shell脚本批量创建服务器上的MySQL数据库账号 ,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对易采站长站网站的支持!
如果你觉得本文对你有帮助,欢迎转载,烦请注明出处,谢谢!