Problems with Mono MySQL 4 and up connectivity

Post here for help with installing or upgrading mojoPortal pre-compiled release packages. When posting in this forum, please provide all relevant details. You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

Post here for help with installation of mojoPortal pre-compiled release packages

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.

You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

This thread is closed to new posts. You must sign in to post in the forums.
7/26/2005 1:25:54 PM
Gravatar
Total Posts 18409

Re: Problems with Mono MySQL 4 and up connectivity

Are you having this problem with mojoportal or with your own app? I'm guessing your own app since mojoportal no longer uses the ByteFX driver.

It could be your problem would go away with the newer Connector for .NET available on the MySQL site but I know I used ByteFX with MySQL 4.0.23 before myself and it worked for me.

You are using the same user in the connection string as for the phpmysql and all of it is running on the same server localhost?

In answer to the question about compiling. I compiled ByteFX and also the newer connector on windows and used it on linux no problem. When you compile in VS.NET you have to use Rebuild instead of Build so that it doesn't do an incremental build.
I've never tried installing it in the GAC on linux, but  for a compiled web app just drop the dll in the bin folder with everything else and it will use it.

It really sounds like it has to be one of a few possible things
 - MySQL is not configured to accept tcp/ip connections
-  The user does not have permission to connect from the host that the web is running on to the host that the db is running on
-  The web server is able to resolve the name of the db server
- a bad connection string, your looks ok but mine is slightly different so it may be worth an experiment

example:
Data Source=localhost;Database=mojo;User ID=mojo;Password=mojo

It could possibly be a bug in mono 1.1.8 but that is not my first suspect

Are you developing on linux or windows?

Are you compiling your web code to a dll or running it inline in scripts tags

The fact that the table editor couldn't connect supports a permission issue as a possibility

You might also post at www.gotmono.com forums
7/26/2005 9:26:30 PM
Gravatar
Total Posts 3

Re: Problems with Mono MySQL 4 and up connectivity

wow. Thanks for the fast reply. Its my own app. I posted here because the same issue had been posted and on the mono list you said you were running mono 1.1.7 and mysql just fine. So I am obviously doing something wrong.

The php and asp.net stuff is all running on localhost (linux box). I was trying the table editor on my windows laptop. I created a bunch of users with different permissions while I was trying to get the php stuff to connect so i've been trying to connect with all of them.

Right after I posted I built the mysql.data connector on windows and put it into the bin dir of my asp page and compiled everything. I am doing the code behind dll action. So I compiled it all with mcs -r:whatever -r:bin/MySql.Data.dll code.aspx.cs etc. Everything compiled fine but I had the same issue with the "unable to connect..." error.

So I will try changing the "Server=" to "Data Source=" and then try to figure out the tcp/ip enable. I dont know about the permissions considering I am trying to connect with the user that has the most permissions (just to get it working) on localhost (and I've tried using the loop back ip).

Thanks again. BTW, I posted on the mono forums too just for good measure :)

Ben
7/27/2005 5:42:21 PM
Gravatar
Total Posts 18409

Re: Problems with Mono MySQL 4 and up connectivity

Yeah I really think the error is telling you the correct thing in this case (not that they always do), it can't connect to the MySQL host for some reason, the most common cause is when MySQL is not configured correctly for tcp/ip connections so I would look very closely into that but it can also be permissions or mismatch between drivers like ByteFX and certain versions of MySQL but I'm pretty sure it starts with the 4.1.x branch of MySQL when ByteFX falls apart. I know for sure I used 4.0.23 with ByteFX a while back on Fedore 2 or 3

Please do post again if you get it figured out as I'm sure it would help others overcome the same problem.

Joe
7/28/2005 4:32:57 PM
Gravatar
Total Posts 3

Re: Problems with Mono MySQL 4 and up connectivity

Oh man, how good it feels to see my dumb little label display "connected." The issue was 100% with mysql.  I totally reinstalled 4.0.25 (I didnt want to mess with the new passwords of 4.1). I dont know what configuration option was wrong but the "-skip-networking" switch was not in the mysqld_start file. From what Ive read thats all that turns off the TCP connections. Either way, if some reader has debian/ubuntu, DONT use the apt-get mysql package.  I grabbed the linux binary from mysql, dumped it in and all was good.

*sigh* I can sleep now.

Ben
You must sign in to post in the forums. This thread is closed to new posts.