This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

eddymaddix10139
eddymaddix10139

This might help some people overcome the MySQL connection error when installing October.

Edit the file './install_files/php/Installer.php'. Find the line:

$dsn = 'mysql:host='.$host.';dbname='.$name;'

around line 136, and edit it to read:

$dsn = 'mysql:unix_socket='.$host.';dbname='.$name;

The host specified by 1and1 is "localhost:/tmp/mysql5.sock" However, as PDO is being used you need to enter "/tmp/mysql5.sock"

The MySQL installation should then succeed.

As ever: IANAL, YMMV

Edit: Of course if you then get a "SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known" error and there are no forum entries and the web is unhelpful, you may just want to give up!

Shame looks like a good CMS but if I can't get it installed ...

Last updated

rich19036
rich19036

You were really close to the solving the MySQL problem with 1and1 shared hosting. Thank you for the pointer- it helped a lot.

Temporary Solution / Workaround

  1. Locate the unix_socket for your MySQL database.
    • Open phpMyAdmin and click on the server name
    • Open 'Variables' tab and search for variable named 'socket'.
    • Note it's value, mine was '/var/run/mysqld/mysqld.sock'
  2. Edit the file './install_files/php/Installer.php'
  3. Scroll down about 133 lines to a case statement for database
  4. Modify line as shown below using your socket variable value

The before & after lines below. Hard code your unix_socket value. If you get a blank screen you've probably got your apostrophe's wrong.
$dsn = 'mysql:host='.$host.';dbname='.$name;
$dsn = 'mysql:host='.$host.';unix_socket=/var/run/mysqld/mysqld.sock;dbname='.$name;

This was one of several challenges installing October CMS on a 1and1 some due to my not being an expert in Linux. Knowing what I do now- a 15 minute install is totally doable on 1and1 shared hosting plan.

Long Term Solution I'm willing to fix the installation process on Github assuming it hasn't been fixed yet or that there isn't a better solution. I'll create an issue on Github and go from there but was thinking of adding a new entry field for socket with blank default value- if no value entered than don't use the parameter otherwise use it.

Last updated

1-2 of 2

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.