pydio / pydio-core

Pydio 8 official repository
https://pydio.com
GNU Affero General Public License v3.0
867 stars 289 forks source link

Can't connect to MySQL server using non-default socket #1160

Closed josh4trunks closed 8 years ago

josh4trunks commented 8 years ago

It is impossible with the pydio WebUI to define a mysql_socket during Installation or in the Settings.

Solution 1 - Allow socket in mysql_host like localhost:/path/to/socket This is how WordPress & ownCloud work. For example, ownCloud has some logic which splits the part after ":" and figures out if it is a file socket, or port. This is then correctly passed to Doctrine in this case. https://github.com/owncloud/core/blob/master/lib/private/db/connectionfactory.php#L160-167

Solution 2 - Add a field to define the file socket to Install and in Database Settings I noticed this was working if I added "mysql_socket":"/path/to/socket", to data/plugins/boot.conf/bootstrap.json.

josh4trunks commented 8 years ago

I can help implement Solution 1 if I could be pointed where the config is passed to Dibi

cdujeu commented 8 years ago

Hi @josh4trunks if you are still interested, you could have a look at the following file : core/src/core/src/pydio/Core/Utils/Vars/OptionsHelper.php function cleanDibiDriverParameters($params) there is a first step loading core connection data, then we clean the params for sqlite. We could add a step here to parse the "host" key here, and replace it by a "socket" key that should be understood by dibi afterward.

josh4trunks commented 8 years ago

Awesome, I would love to test your fix. But, for some reason my pydio install sees 6.4.2 as the latest update?

cdujeu commented 8 years ago

yes it's normal, it's still the last stable. Try to get the most recent from https://download.pydio.com/pub/core/ci/?C=M;O=D

josh4trunks commented 8 years ago

Ok makes sense. When I have a chance I'll test one of those builds for the socket connection.

josh4trunks commented 7 years ago

I upgraded to v7.0.0 and this is working well for me. Thanks!