广东智唯网站建设公司,绥化网站建设兼职,做网站用vue吗,做网站备案好还是不备案好如果我使用自定义main(void main()而不是shared static this()),一切正常.使用默认主菜单时出现“访问冲突”错误.它看起来像MySQL不允许从localhost连接到它,但在my.ini中我添加了字符串#xff1a;bind-address 127.0.0.1代码,如果有帮助#xff1a;import std.stdio;impo…如果我使用自定义main(void main()而不是shared static this()),一切正常.使用默认主菜单时出现“访问冲突”错误.它看起来像MySQL不允许从localhost连接到它,但在my.ini中我添加了字符串bind-address 127.0.0.1代码,如果有帮助import std.stdio;import std.path;import std.file;import std.string;import dini;import vibe.d;import colorize;import ddbc.all;shared static this(){auto settings new HTTPServerSettings;settings.port 8080;settings.bindAddresses [::1, 127.0.0.1];listenHTTP(settings, hello);auto parseconfig new ParseConfig();auto db new DBConnect(parseconfig);}void hello(HTTPServerRequest req, HTTPServerResponse res){res.writeBody(Hello, World!);}class ParseConfig{string dbname;string dbuser;string dbpass;string dbhost;string dbport;this(){try{//getcwd do not return correct path if run from task shoulderstring confpath buildPath((thisExePath[0..((thisExePath.lastIndexOf(\\))1)]), config.ini);//writefln(thisExePath[0..((thisExePath.lastIndexOf(\\))1)]); // get path without extention 1 is for getting last slash//string confpath buildPath(thisExePath, config.ini);if (!exists(confpath)){writeln(ERROR: config.ini do not exists);}auto config Ini.Parse(confpath);try{this.dbname config.getKey(dbname);this.dbuser config.getKey(dbuser);this.dbpass config.getKey(dbpass);this.dbhost config.getKey(dbhost);this.dbport config.getKey(dbport);}catch (Exception msg){cwritefln(ERROR: Cant parse config: %s.color(fg.red), msg.msg);}}catch(Exception msg){cwriteln(msg.msg.color(fg.red));core.thread.Thread.sleep( dur!(msecs)(1000));}}}class DBConnect{Statement stmt;ParseConfig parseconfig;this(ParseConfig parseconfig){try{this.parseconfig parseconfig;MySQLDriver driver new MySQLDriver();string url MySQLDriver.generateUrl(parseconfig.dbhost, to!short(parseconfig.dbport), parseconfig.dbname);string[string] params MySQLDriver.setUserAndPassword(parseconfig.dbuser, parseconfig.dbpass);DataSource ds new ConnectionPoolDataSourceImpl(driver, url, params);auto conn ds.getConnection();scope(exit) conn.close();stmt conn.createStatement();writefln(\n[Database connection OK]);}catch (Exception ex){writefln(ex.msg);writeln(Could not connect to DB. Please check settings);}}}我也运行下一个命令授予所有特权*.*””””””””””””””””””””””””””’FLUSH特权;我也尝试了不同的绑定地址,如0.0.0.0和localhost但没有结果.每次新绑定后,我都重启了MySQL服务.怎么了