The Apache Haus Forum

Advanced search  

News:

Welcome to Apache Haus Distribution Forum

Pages: [1] 2   Go Down

Author Topic: Can't load driver file apr_dbd_mysql.so  (Read 13221 times)

VaughanR

  • Newbie
  • *
  • Offline Offline
  • Posts: 10
Can't load driver file apr_dbd_mysql.so
« on: September 26, 2014, 07:20:44 AM »

I am having trouble getting httpd to start.  I am trying to use mysql and have the following mod_dbd configuration directives in my httpd.conf file:

# mod_dbd configuration
DBDriver mysql
DBDParams "host=localhost dbname=myDb user=myuser pass=somepass"
DBDMin          4
DBDKeep         8
DBDMax          20
DBDExptime      300

However, when I try to start httpd it comes up with a syntax error for the DBDriver line and an explanation:
"Can't load driver file apr_dbd_mysql.so"

I have installed httpd using this file httpd-2.4.10-x64-vc11.zip on a Windows 7 64bit system and I can see a file apr_dbd_mysql-1.dll in the ./bin directory.  I have Microsoft Visual C++ Redistributable (x64) Update 4 installed.

Has anyone managed to overcome this issue?
Logged

Gregg

  • Administrator
  • Member Elite
  • *****
  • Offline Offline
  • Posts: 847
Re: Can't load driver file apr_dbd_mysql.so
« Reply #1 on: September 26, 2014, 07:58:31 AM »

try adding a copy of libmysql.dll into Apache's /bin folder.
Logged

VaughanR

  • Newbie
  • *
  • Offline Offline
  • Posts: 10
Re: Can't load driver file apr_dbd_mysql.so
« Reply #2 on: September 26, 2014, 09:32:56 AM »

I assume you mean the file libmysql.dll from the MySql Server 5.6/lib folder. If so, I did that but I still get the same error.  I would note that I did not install apache into C:\Apache24, would that cause a problem?
Logged

Gregg

  • Administrator
  • Member Elite
  • *****
  • Offline Offline
  • Posts: 847
Re: Can't load driver file apr_dbd_mysql.so
« Reply #3 on: September 26, 2014, 11:50:55 AM »

It shouldn't but where did you install it to?

I'm upover and it's way past bedtime, I'll look into it tomorrow.
Logged

Gregg

  • Administrator
  • Member Elite
  • *****
  • Offline Offline
  • Posts: 847
Re: Can't load driver file apr_dbd_mysql.so
« Reply #4 on: September 26, 2014, 09:01:49 PM »

OK, here's the rub.

MySQL from 5.4 on does not export the my_init function which this connector calls. That means the connector will not compile with 5.4 and up. We compile it against 5.1.

I thought there was a bug report about this but I found nothing in bugzilla. It was sent in an email to [email protected] and basically ignored.

Here's libmysql from 5.1.something-within-the-past-year that the connector was compiled with. I cannot guarantee however that it will connect to MySQL 5.4 and up. I guess you can try.

[Links removed, apr_dbd_mysql is now being built against MySQL 5.5]

I'll discuss this with one of the APR devs and see what we come up with. I'll probably have to create a bug report myself.

I've never locked anything in my config or user/passwords into a MySQL database so I've never been that concerned about it to be honest. The person that originally requested we build this connector has never said anything about it, I assume either it works for them or they still hang onto MySQL 5.1.

« Last Edit: April 10, 2015, 08:12:39 AM by Gregg »
Logged

VaughanR

  • Newbie
  • *
  • Offline Offline
  • Posts: 10
Re: Can't load driver file apr_dbd_mysql.so
« Reply #5 on: September 27, 2014, 12:30:36 AM »

Thanks for all your help with this Gregg.  I will try one of those libmysql's you listed.

I installed it in c:\Program Files\Apache2.4, but to make sure location wasn't a problem I also created a symbolic link from C:\Apache24 to that directory using mklink in a cmd window.

Interestingly I am trying to get a version of Apache2.4 running on windows to use for development.  I had Apache2.2 running in cygwin but when I upgraded the server to Centos7 it meant that it was running Apache2.4, so I needed to upgrade windows to that.  I was successfully using cygwin and Apache2.2 with MySql5.6, but cygwin does not have Apache2.4 (yet), neither does RedhatCygwin so I had to look for another alternative.  I note that cygwin was also using apr1.4.8 and apr-util1.5.3.  I have uninstalled apache and apr* from cygwin in case that was an issue.
« Last Edit: September 27, 2014, 03:14:31 AM by VaughanR »
Logged

VaughanR

  • Newbie
  • *
  • Offline Offline
  • Posts: 10
Re: Can't load driver file apr_dbd_mysql.so
« Reply #6 on: September 27, 2014, 12:37:45 AM »

Well, I can report that httpd now starts, but I will need to test whether it can access mysql5.6 successfully.
Logged

VaughanR

  • Newbie
  • *
  • Offline Offline
  • Posts: 10
Re: Can't load driver file apr_dbd_mysql.so
« Reply #7 on: September 27, 2014, 12:42:59 AM »

Hmm, I spoke too soon.  There are now no errors in parsing the httpd.conf file, but I am getting this error when I try and start it as a service:
The Apache2.4 service terminated with service-specific error Incorrect function..
Logged

Gregg

  • Administrator
  • Member Elite
  • *****
  • Offline Offline
  • Posts: 847
Re: Can't load driver file apr_dbd_mysql.so
« Reply #8 on: September 27, 2014, 04:41:31 AM »

You will have to check the Event Log for that one
Logged

VaughanR

  • Newbie
  • *
  • Offline Offline
  • Posts: 10
Re: Can't load driver file apr_dbd_mysql.so
« Reply #9 on: September 27, 2014, 10:00:27 AM »

That was the error from the event log.
Logged

Gregg

  • Administrator
  • Member Elite
  • *****
  • Offline Offline
  • Posts: 847
Re: Can't load driver file apr_dbd_mysql.so
« Reply #10 on: September 27, 2014, 07:30:26 PM »

I guess I'll just have to investigate with mysql 5.6. I suppose however I should find out what you are doing with this and how. I have no mysql and it starts as service with your above configuration example.
Logged

Gregg

  • Administrator
  • Member Elite
  • *****
  • Offline Offline
  • Posts: 847
Re: Can't load driver file apr_dbd_mysql.so
« Reply #11 on: September 27, 2014, 10:17:12 PM »

It looks like this was fixed on mysql's side, I just compiled apr_dbd_mysql on VC9 against libmysql.dll version 5.6.21.
Now, with all the versions of mysql floating out there, which to choose to compile against, 5.1 or 5.6. Maybe I'll do the vc9 builds with 5.1 and the vc11 builds with 5.6.

I haven't had time to set up mysql and import a test database to test the connector for authentication yet. I'm still in the middle of reading since I am not versed in mysql.
Logged

VaughanR

  • Newbie
  • *
  • Offline Offline
  • Posts: 10
Re: Can't load driver file apr_dbd_mysql.so
« Reply #12 on: September 29, 2014, 12:56:00 AM »

Gregg, thanks again for all your help with this.
Yes, mysql starts as a service.
Logged

Gregg

  • Administrator
  • Member Elite
  • *****
  • Offline Offline
  • Posts: 847
Re: Can't load driver file apr_dbd_mysql.so
« Reply #13 on: September 29, 2014, 03:23:07 AM »

Seeing as it's a connector and connects over tcp 3606 I do not understand why you're getting what you were getting.
I'll crank up my vc11 build system here in awhile and download mysql 5.6 x64 and build connectors against it. I still have some chores to finish first.
Logged

Gregg

  • Administrator
  • Member Elite
  • *****
  • Offline Offline
  • Posts: 847
Re: Can't load driver file apr_dbd_mysql.so
« Reply #14 on: September 30, 2014, 01:54:17 AM »

G'day

Edit: Old dead link that people still follow removed. There is no need now as the mysql conector is compiled with 5.6 now.

this is from APR-Util 1.5.4 so has a change from the one distributed with 2.4.10:

*) MySQL driver: Fix incorrect handling of bad parameter in the
    driver support for apr_dbd_transaction_end().  PR 56330.
    [Weiqiang Li <weiqiang_li hotmail.com>]

I hope it works for you.

« Last Edit: October 20, 2016, 11:38:02 PM by Gregg »
Logged
Pages: [1] 2   Go Up
 

Sitemap 1 2 3 4 5 6 7 8 9 10 11 12 13