RejectedSoftware Forums

Sign up

MySQL troubles

I think there might be some changes from simendsjo's misc-cleanups
branch of mysqln that need merged into Vibe.d's branch. The
simendsjo/misc-cleanups version is working fine for me in Vibe.d
v0.7.8 (although using the MySQL connection pooling class results in
compilation errors - haven't looked into them so I don't know offhand
if they're trivial to fix). But using Vibe.d's own mysqln just gives me
this:

new Connection("localhost", "testdbuser", "testpass", "testdb", 3306,
defaultClientFlags);

-->

Authentication failure: Access denied for user 'testdbuser'@'%' to
database 't'

Note the database name in the error is truncated. And then it dies with:
core.exception.InvalidMemoryOperationError
core.exception.InvalidMemoryOperationError

(Yes, doubled like that.)

Re: MySQL troubles

Am 10/24/2012 10:00 PM, schrieb Nick Sabalausky:

I think there might be some changes from simendsjo's misc-cleanups
branch of mysqln that need merged into Vibe.d's branch. The
simendsjo/misc-cleanups version is working fine for me in Vibe.d
v0.7.8 (although using the MySQL connection pooling class results in
compilation errors - haven't looked into them so I don't know offhand
if they're trivial to fix). But using Vibe.d's own mysqln just gives me
this:

new Connection("localhost", "testdbuser", "testpass", "testdb", 3306,
defaultClientFlags);

-->

Authentication failure: Access denied for user 'testdbuser'@'%' to
database 't'

Note the database name in the error is truncated. And then it dies with:
core.exception.InvalidMemoryOperationError
core.exception.InvalidMemoryOperationError

(Yes, doubled like that.)

OK I'll try to merge his clean ups, at least this should improve the
situation somewhat. We really need a proper maintainer though (i.e. one
who eats his own dogfood)

Re: MySQL troubles

On Thu, 25 Oct 2012 07:52:48 +0200
Sönke Ludwig sludwig@rejectedsoftware.com wrote:

Am 10/24/2012 10:00 PM, schrieb Nick Sabalausky:

I think there might be some changes from simendsjo's misc-cleanups
branch of mysqln that need merged into Vibe.d's branch. The
simendsjo/misc-cleanups version is working fine for me in Vibe.d
v0.7.8 (although using the MySQL connection pooling class results in
compilation errors - haven't looked into them so I don't know
offhand if they're trivial to fix). But using Vibe.d's own mysqln
just gives me this:

new Connection("localhost", "testdbuser", "testpass", "testdb",
3306, defaultClientFlags);

-->

Authentication failure: Access denied for user 'testdbuser'@'%' to
database 't'

Note the database name in the error is truncated. And then it dies
with: core.exception.InvalidMemoryOperationError
core.exception.InvalidMemoryOperationError

(Yes, doubled like that.)

OK I'll try to merge his clean ups, at least this should improve the
situation somewhat.

Damn, now it's giving me "Server doesn't support protocol v4.1
passwords" which is seems very, very weird since I've got 5.x server
and am definitely using a user with a new/long-style password.
Temporarily commenting out that particular check results in "Operating
on TcpConnection owned by a different fiber!" which seems even weirder
since I'm pretty sure I'm using the MySQL connection pool thing
correctly. I need to dig into this more, this is all very strange,
maybe it's something screwy on my system...

Thanks very much for the merge, though.

We really need a proper maintainer though (i.e.
one who eats his own dogfood)

Simendsjo has mentioned that to me before, too. As nobody's stepped up
and as I appear to be to biggest Vibe.d+MySQL user AFAIK, perhaps I'll
volunteer after all. I can't guarantee much in the way of updates, but
what exactly sorts of tasks do you have in mind? (Aside from trying to
work out my current problem ;) )

Re: MySQL troubles

Am 10/25/2012 10:14 AM, schrieb Nick Sabalausky:

On Thu, 25 Oct 2012 07:52:48 +0200
Sönke Ludwig sludwig@rejectedsoftware.com wrote:

Am 10/24/2012 10:00 PM, schrieb Nick Sabalausky:

I think there might be some changes from simendsjo's misc-cleanups
branch of mysqln that need merged into Vibe.d's branch. The
simendsjo/misc-cleanups version is working fine for me in Vibe.d
v0.7.8 (although using the MySQL connection pooling class results in
compilation errors - haven't looked into them so I don't know
offhand if they're trivial to fix). But using Vibe.d's own mysqln
just gives me this:

new Connection("localhost", "testdbuser", "testpass", "testdb",
3306, defaultClientFlags);

-->

Authentication failure: Access denied for user 'testdbuser'@'%' to
database 't'

Note the database name in the error is truncated. And then it dies
with: core.exception.InvalidMemoryOperationError
core.exception.InvalidMemoryOperationError

(Yes, doubled like that.)

OK I'll try to merge his clean ups, at least this should improve the
situation somewhat.

Damn, now it's giving me "Server doesn't support protocol v4.1
passwords" which is seems very, very weird since I've got 5.x server
and am definitely using a user with a new/long-style password.
Temporarily commenting out that particular check results in "Operating
on TcpConnection owned by a different fiber!" which seems even weirder
since I'm pretty sure I'm using the MySQL connection pool thing
correctly. I need to dig into this more, this is all very strange,
maybe it's something screwy on my system...

Thanks very much for the merge, though.

We really need a proper maintainer though (i.e.
one who eats his own dogfood)

Simendsjo has mentioned that to me before, too. As nobody's stepped up
and as I appear to be to biggest Vibe.d+MySQL user AFAIK, perhaps I'll
volunteer after all. I can't guarantee much in the way of updates, but
what exactly sorts of tasks do you have in mind? (Aside from trying to
work out my current problem ;) )

It's possible that you hit a bad intermediate vesion (I needed some
testing to fix up parsing the greeting message). Can you retry?

Re: MySQL troubles

On Thu, 25 Oct 2012 10:33:07 +0200
Sönke Ludwig sludwig@rejectedsoftware.com wrote:

It's possible that you hit a bad intermediate vesion (I needed some
testing to fix up parsing the greeting message). Can you retry?

Hmm, it had been a intermediate version (85ff557788), but I get the
same results with the latest (ec3714e244). Think it might matter
that I'm using vibe.d v0.7.8 instead of of master?

However, I've just noticed that what does work is if I do
both of the following:

  1. Use "auto conn = dbPool.lockConnection();" instead of "auto conn =
    dbPool.lockConnection().m_conn;" (Dumb mistake on my part, I guess)

And

  1. Comment out line 2182 in mysql/connection.d:

enforceEx!MYX(sCaps & SvrCapFlags.SECUREPWD, "Server doesn't support
protocol v4.1 passwords");

Perhaps there's something wrong with that check? FWIW, my MySQL server
is 5.0.91 on Win7. I think that was one of simendsjo's changes, though.
Maybe he can tell us more about it.

Re: MySQL troubles

On Thu, 25 Oct 2012 05:17:39 -0400
Nick Sabalausky SeeWebsiteToContactMe@semitwist.com wrote:

  1. Comment out line 2182 in mysql/connection.d:

enforceEx!MYX(sCaps & SvrCapFlags.SECUREPWD, "Server doesn't support
protocol v4.1 passwords");

Perhaps there's something wrong with that check? FWIW, my MySQL server
is 5.0.91 on Win7. I think that was one of simendsjo's changes,
though. Maybe he can tell us more about it.

Figured it out, pull request:
https://github.com/rejectedsoftware/mysql-native/pull/1

Re: MySQL troubles

Am 10/26/2012 8:02 AM, schrieb Nick Sabalausky:

On Thu, 25 Oct 2012 05:17:39 -0400
Nick Sabalausky SeeWebsiteToContactMe@semitwist.com wrote:

  1. Comment out line 2182 in mysql/connection.d:

enforceEx!MYX(sCaps & SvrCapFlags.SECUREPWD, "Server doesn't support
protocol v4.1 passwords");

Perhaps there's something wrong with that check? FWIW, my MySQL server
is 5.0.91 on Win7. I think that was one of simendsjo's changes,
though. Maybe he can tell us more about it.

Figured it out, pull request:
https://github.com/rejectedsoftware/mysql-native/pull/1

Merged in.

btw, my fingers are itching everytime I see that connection.d file. I
would really like to rip apart this huge mess and restructure everything

  • I hate those gigantic spaghetti modules. But then again I'd rather
    leave it like this to keep it compatible with the other forks..

Re: MySQL troubles

On Fri, 26 Oct 2012 09:40:15 +0200
Sönke Ludwig sludwig@rejectedsoftware.com wrote:

Merged in.

Thanks.

btw, my fingers are itching everytime I see that connection.d file. I
would really like to rip apart this huge mess and restructure
everything

  • I hate those gigantic spaghetti modules. But then again I'd rather

leave it like this to keep it compatible with the other forks..

The simendsjo fork is the only other one I'm aware of (other than Steve
Teale's original, but I think it's safe to assume Teale's not likely to
continue it since nobody's heard from him in a year). And, though I hate
to put words in anyone's mouth, simendsjo doesn't seem particularly
interested anymore: IIRC, he's said he's not using MySQL anymore, and
his last commit was a few months ago.

So unless there's other active forks I don't know about, I think this
might actually be a perfect time for restructuring, especially since the
vibe.d fork has just been synched up with simendsjo's.

Speaking of restructuring, I just noticed that there's another mysql
connection pool class inside connection.d. Probably one of simendsjo's
additions. We should probably look at that, pull anything good out into
the class in 'mysql/db.d', and then remove the one in connection.d.

Also on the same topic, do you think the Connection class in mysql/db.d
should maybe be renamed to something like "MySqlConnectionPool"?
"Connection" seems misleadingly generic, as if it's a parent interface
to TcpConnection and UdpConnection.

Re: MySQL troubles

Am 10/26/2012 10:23 AM, schrieb Nick Sabalausky:

On Fri, 26 Oct 2012 09:40:15 +0200
Sönke Ludwig sludwig@rejectedsoftware.com wrote:

Merged in.

Thanks.

btw, my fingers are itching everytime I see that connection.d file. I
would really like to rip apart this huge mess and restructure
everything

  • I hate those gigantic spaghetti modules. But then again I'd rather
    leave it like this to keep it compatible with the other forks..

The simendsjo fork is the only other one I'm aware of (other than Steve
Teale's original, but I think it's safe to assume Teale's not likely to
continue it since nobody's heard from him in a year). And, though I hate
to put words in anyone's mouth, simendsjo doesn't seem particularly
interested anymore: IIRC, he's said he's not using MySQL anymore, and
his last commit was a few months ago.

So unless there's other active forks I don't know about, I think this
might actually be a perfect time for restructuring, especially since the
vibe.d fork has just been synched up with simendsjo's.

I thought I had seen another one, but I will check again and put it on
the todo list if not.

Speaking of restructuring, I just noticed that there's another mysql
connection pool class inside connection.d. Probably one of simendsjo's
additions. We should probably look at that, pull anything good out into
the class in 'mysql/db.d', and then remove the one in connection.d.

Ah right, I've seen that during merging and the forgot about it...

Also on the same topic, do you think the Connection class in mysql/db.d
should maybe be renamed to something like "MySqlConnectionPool"?
"Connection" seems misleadingly generic, as if it's a parent interface
to TcpConnection and UdpConnection.

Yes, and it would also be in line with the MongoDb and Redis classes.