MCPcopy Create free account
hub / github.com/Tencent/phxsql / GetCreateUserStr

Method GetCreateUserStr

phxbinlogsvr/core/mysql/mysql_string_helper.cpp:45–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45string MySqlStringHelper::GetCreateUserStr(const string &username, const string &pwd) {
46 char cmd[1024];
47 if(pwd.empty()) {
48 sprintf(cmd, "create user %s;", username.c_str());
49 }
50 else {
51 sprintf(cmd, "create user %s@'127.0.0.1' identified by '%s';", username.c_str(), pwd.c_str());
52 }
53 return cmd;
54}
55
56string MySqlStringHelper::GetRevokeAdminUserStr(const string &admin_username, const string &admin_pwd,
57 const string &svr_ip) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected