mono连接mysql时的ArgumentNullException的解决

    最近在搞ubuntu+mono+mysql+asp.net。在mono使用mysqlconnector连接mono时遇到了一个问题:当我要用MySqlConnection打开连接的时候,也就是调用Open()函数时,错误就发生了。也就是

    System.ArgumentNullException

    很是奇怪,从网上找来找去都找不到解决办法。

    后来,看到一个帖子,作者说他遇到打开mysql连接的时候发生类似问题,最后是修改mysql的配置文件my.cnf的地址绑定设定后就没事了。也就是这一段:

# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#bind-address           = 172.22.60.126

   把bind-address这是掉,就没事了。我试了一下,真的就可以了。

  于是,又想重新再让错误重现。就去掉了bind-address,重启mysql,重启jexus。结果错误不再出现了。真是奇怪了。

  唉,mono还是要多多加油啊。还有自己也要多多积累啊。

猜你喜欢

转载自happear.iteye.com/blog/1679906