开发者

Can't connect to local MySQL DB using the .NET connector

I've got a locally installed MySQL database server that I want to use for development for my MVC 2 project. I installed the 64 bit version of MySQL and set up my schemas. I didn't change any of the defaults except for the root password. I've also installed the 32 bit .NET connec开发者_如何学Gotor and I'm using VS2010.

I can't get VS to connect to MySQL. I set the server to "localhost" (also have tried 127.0.0.1), user name to "root", and the password. It can't connect. I've also tried specifying the database I want to connect to with no luck. I can, however, ping the server via "mysqladmin -h localhost -u root -p XXX ping".

Something interesting that I noticed was that when I opened the Advanced options, the connection string that the connector was building under the options didn't include a password, just "server=localhost;username=root" and whatever options I fiddled with. I'm guessing that's for security reasons, but if it's not adding the password to the connection string that's obviously a problem (that I don't know how to fix).

I have to admit that databases and networking aren't my strong suits, but I still didn't anticipate this much trouble. I'm beginning to think that I might have set up my database incorrectly, but I'm not sure what to look for.


I figured this out a good while back, should have updated this a long time ago. My MySQL server didn't install correctly for some reason, and reinstalling was a pain because the process kept failing when I tried to reinstall it. I did manage to find a solution to the problem here: https://serverfault.com/questions/214435/error-1067-the-process-terminated-unexpectedly-when-trying-to-install-mysql-o


I had the same error. I changed localhost for 127.0.0.1 instead and it seems to work for me.

I'm still looking for the reason why Windows doesn't let me use localhost (because, as I've read already, it's a Windows error).


Localhost is ::1 in IPv6.

It tries to connect with IPv4, which is 127.0.0.1.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜