iferr:=excuteSql(app.ContainerName,app.Password,fmt.Sprintf("create database if not exists %s character set=%s",mysqlDto.Name,mysqlDto.Format));err!=nil{
iferr:=excuteSql(app.ContainerName,app.Password,fmt.Sprintf("create database if not exists `%s` character set=%s",mysqlDto.Name,mysqlDto.Format));err!=nil{
returnerr
}
tmpPermission:=mysqlDto.Permission
iferr:=excuteSql(app.ContainerName,app.Password,fmt.Sprintf("create user if not exists '%s'@'%s' identified by '%s';",mysqlDto.Username,tmpPermission,mysqlDto.Password));err!=nil{
returnerr
}
grantStr:=fmt.Sprintf("grant all privileges on %s.* to '%s'@'%s'",mysqlDto.Name,mysqlDto.Username,tmpPermission)
grantStr:=fmt.Sprintf("grant all privileges on `%s`.* to '%s'@'%s'",mysqlDto.Name,mysqlDto.Username,tmpPermission)
ifapp.Version=="5.7.39"{
grantStr=fmt.Sprintf("%s identified by '%s' with grant option;",grantStr,mysqlDto.Password)