Author Topic: MySQL question...  (Read 3610 times)

Offline starion

  • Jr. Member
  • **
  • Posts: 32
MySQL question...
« on: June 08, 2015, 12:25:50 AM »
Dumb question, but is it necessary to install MySQL on the Roundcube machine when the actual Roundcube database is going to be hosted remotely on another server?  I guess what I'm thinking; is Roundcube a MySQL client (or have client functionality) or does it use a client installed on the same machine on which it resides?

Offline alec

  • Hero Member
  • *****
  • Posts: 1,365
Re: MySQL question...
« Reply #1 on: June 08, 2015, 02:41:33 AM »
No, you don't need a mysql server on the webserver. All you need is PHP's pdo-mysql extension (which may or may not use libmysqlclient library).

Offline starion

  • Jr. Member
  • **
  • Posts: 32
Re: MySQL question...
« Reply #2 on: June 08, 2015, 09:07:22 AM »
Okay, then this is not the problem.  I checked and php-pdo is installed.

During the installation phase of Roundcube, I am getting an error saying it can't connect to my database.  I have checked and double-checked the settings in the config, have entered all the pertinent information for my server.  I can connect to my Roundcube database with a MySQL client using said credentials.

Any suggestions?
« Last Edit: June 08, 2015, 11:43:02 AM by starion »

Offline alec

  • Hero Member
  • *****
  • Posts: 1,365
Re: MySQL question...
« Reply #3 on: June 08, 2015, 09:45:52 AM »
Does it log anything into the Roundcube (or Apache) error log?

Offline starion

  • Jr. Member
  • **
  • Posts: 32
Re: MySQL question...
« Reply #4 on: June 11, 2015, 03:53:08 PM »
There is no roundcube log created yet, httpd logs do not show any error, just the normal information for displaying the installer page.  The only error I get is on the installer page:

"DSN (write):  NOT OK(SQLSTATE[HY000] [2003] Can't connect to MySQL server on 'db1.starionhost.net' (13))"

Make sure that the configured database exists and that the user has write privileges
DSN: mysql://roundcube:passwordmasked@db1.starionhost.net/roundcubemail

As I stated previously, I am able to login to the roundcube database with MySQL Workbench using the same information as listed on the line above.

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,879
    • SKaero - Custom Roundcube development

Offline starion

  • Jr. Member
  • **
  • Posts: 32
Re: MySQL question...
« Reply #6 on: June 11, 2015, 05:34:34 PM »
To summarize SKaero's link, it appears to be selinux blocking it.  Issuing the following took care of it for me:

(Note that if you just want to test to see if this will fix it for you, omit the "-P" directive.  Otherwise "-P" makes the setting permanent.)

setsebool -P httpd_can_network_connect_db on

CentOS 7 with Apache 2.6, PHP 5.6