Support recent ByteFX and MySQL > 4.0

This is a forum to suggest new features for mojoPortal. 

This thread is closed to new posts. You must sign in to post in the forums.
4/22/2005 11:27:24 AM
Gravatar
Total Posts 5

Support recent ByteFX and MySQL > 4.0

Hi,

  This seems more of a feature request than a bug, per se, so I'll post it here.

  I recently got mojoportal running under the latest version of Mono, but had some difficulties with the included MySQL library, since it doesn't seem to play well with MySQL > 4.0 - apparantly due to the newer encrypted login protocol, but there may be other reasons.  All I got from the exception was that it couldn't connect to any of the servers....

  So, I decided to try the ByteFX library which is included by default with Mono.  It connects to my MySQL 4.1.10 server ok, but I had to use the techniques described here:

                     http://dev.mysql.com/doc/mysql/en/old-client.html

to get around the newer encryption.  After getting some sample code working, I tried to uncomment the ByteFX includes in dbPortal.cs and build a new mojoPortal.Data.dll.  It compiled ok and accepted ByteFX.Data.dll as a reference, but at runtime I got errors about unknown SQL syntax. 

  The problem is that newer MySQL and ByteFX wants "@" as a parameter markers, instead of "?".   So, I  searched and replaced  every instance of "?" with "@", rebuilt again and referenced ByteFX.Data.dll, and everything works ok.

  So then, my request might be obvious by now, I'd like to see dbPortal.cs use a global variable to allow the parameter marker to be configured easily for either library, so instead of hardcode question-marks, it would use something like:

static string P = "@";  // or ?
newMySqlParameter(P + "AllowNewRegistration", MySqlDbType.Int32);
sqlCommand.Append(" " + P + "SiteName , ");

I suppose it'd be kind of a pain to get used to writing new parameters using "P", but it'd sure make it easier to get things working with ByteFX and newer MySQL.

FWIW.




 this will open mojoportal up to a wider audience, imho, since there are a lot of users of MySQL > 4.0 nowadays.

  FWIW.



4/22/2005 1:26:54 PM
Gravatar
Total Posts 18439

Re: Support recent ByteFX and MySQL > 4.0

Actually, I was using ByteFX in previous releases of mojoportal and switched to the newer MySQL Connector for .NET because users with certain versions of MySQL 4.1 were complaining that the ByteFX driver did not work for them. The newer MySQL Connector for .NET needs the ? while the ByteFX needs the @, that part has nothing to do with which version of MySQL.

It sounds to me like you are reporting just the opposite of what others are saying and that the ByteFX worked for you where MySQL Connector did not? That is very surprising since the MySQL Connector included in the most recent version of mojoportal is the newer driver. ByteFX is never going to have any enhancements or bug fixes as the author Reggie Burnett now works for MySQL and also wrote the newer MySQL Connector.

I have actually been considering going back to the ByteFX driver due to licensing issues with the newer MySQL Connector.

I am currently running MySQL 4.0.23. I will have to upgrade sometime soon and experiment myself before making a decision. My main reason for upgrading from ByteFX to the newer MySQL Connector was because I was told that the ByteFX driver did not work with MySQL 4.1 and newer whereas the MySQL Connector did.

To me it sounds like
http://dev.mysql.com/doc/mysql/en/old-client.html
solved the problem for ByteFX but required using the older security model

But the newer MySQL Connector is supposed to work with newer versions of MySQL even including version 5 so I would assume it does support the newer security model. I'm thinking that perhaps the newer security model requires a different syntax in the connection string and that may have been the original problem you were having. Or perhaps the same fix for ByteFX would have made the Connector work.
4/23/2005 1:30:49 PM
Gravatar
Total Posts 5

Re: Support recent ByteFX and MySQL > 4.0

2/2005 6:26:54 PM

>It sounds to me like you are reporting just the opposite of what others are saying and >that the ByteFX worked for you where MySQL Connector did not?

Yup.  I dorked around with the default connector for quite awhile, before deciding to try ByteFX.  I consistently got only the "none of the connections strings worked" message.   I finally wrote up a little test app and compiled first with the default connector, then with ByteFX.  Same message from the default, but ByteFX told me that the encryption was a problem.  After resetting the password for mojo using OLD_PASSWORD() in mysql client, ByteFX connects fine, while the MySQL connector still hangs and eventually reports the same failure.

I tried every permutation on connection string, and even (after reading the thread here about it) tried unix sockets, grasping at straws, since I know the mysqld is listening on TCP.

Perhaps you'll observe the problem when you upgrade to 4.1.x or higher.  I don't know.  It's no problem to fix it for a release, but it makes it challenging to follow your svn version, in any case.

Thanks again for a nice app.  Now if I could just figure out how to change to a new CSS...

Bill

4/23/2005 2:08:07 PM
Gravatar
Total Posts 18439

Re: Support recent ByteFX and MySQL > 4.0

I'll try to upgrade in the near future and investigate this further.  One thing I learned I can do that might help. In the documentation for MySQL Connector it says I can use a setting to make it work with the old @ parameters though they recommend using the newer ?.  So I could possibly make it where you only had to comment out the connector and un comment the ByteFX reference.

I'll post here again when I know more and figure out the best thing to do.

re: CSS

The css file is easily changed in the skin file. If you only have 1 site setup your site id is 1
The skin file is the name of the file you see in the dropdown for skins after clicking the Admin menu.
The location of the files is

siteroot/Data/Sites/[SiteID]/skins/*.ascx

you can specify the .css file in the markup tag portal:StyleSheet
you must put the .css file in
siteroot/Data/Sites/[SiteID]/style/

The best thing to do is make a new skin by copying an existing one and rename it and drop it back in the folder with the others. Then create a .css file with a name corresponding to your skin.

Hope that helps,

Joe

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