- Posts: 1
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Error to Install LS 4.1.17 with MySQL 8 and InnoDB.
- leandroOsBr
- Topic Author
- Offline
- New Member
Less
More
3 years 11 months ago #197502
by leandroOsBr
Error to Install LS 4.1.17 with MySQL 8 and InnoDB. was created by leandroOsBr
I had a problem when I went to install the Lime Survey 4.1.17 com MySQL version 8.0.9.
The enviroment I'm using is Digital Ocean With MySQL as the Platform. In this environment, MySQL MyISAM is disabled and, therefore, I can only use InnoDB.
First error:
Message...
"Please fix the following input errors:
You need to enable large_file_prefix setting in your database configuration in order to use InooDb engine for LimeSurvey!
Your database configuration needs to have innodb_file_format and innodb_file_format_max set to use the Barracuda format in order to use InooDb engine for LimeSurvey!"
however, as it is MySQL version 8, these environment variables no longer exist.
So that I could proceed, I edited the file: ".application/models/InstallerConfigForm.php":
Where was:
I Changed to:
I just commented not to make these checks.
Fix this, the following error: Database Connection error!
I notice that "$this->dblocation", when the port is specified, It brought port information in the host parameter, getting "{host=host:port}".
To Fix it, I edited the file".application/models/InstallerConfigForm.php" and made the following corrections:
Where was:
I changed to:
Creating the function:
This way, I was able to proceed and complete the installation.
I believe that this code must be reviewed by the developers to correct this and other erros.
Then, share the workaround.
Regards.
The enviroment I'm using is Digital Ocean With MySQL as the Platform. In this environment, MySQL MyISAM is disabled and, therefore, I can only use InnoDB.
First error:
Message...
"Please fix the following input errors:
You need to enable large_file_prefix setting in your database configuration in order to use InooDb engine for LimeSurvey!
Your database configuration needs to have innodb_file_format and innodb_file_format_max set to use the Barracuda format in order to use InooDb engine for LimeSurvey!"
however, as it is MySQL version 8, these environment variables no longer exist.
So that I could proceed, I edited the file: ".application/models/InstallerConfigForm.php":
Where was:
Code:
if ($this->isMysql && $this->dbengine === self::ENGINE_TYPE_INNODB) { if (!$this->isInnoDbLargeFilePrefixEnabled()) { $this->addError($attribute, gT('You need to enable large_file_prefix setting in your database configuration in order to use InnoDB engine for LimeSurvey!')); } if (!$this->isInnoDbBarracudaFileFormat()) { $this->addError($attribute, gT('Your database configuration needs to have innodb_file_format and innodb_file_format_max set to use the Barracuda format in order to use InnoDB engine for LimeSurvey!')); } }
I Changed to:
Code:
if ($this->isMysql && $this->dbengine === self::ENGINE_TYPE_INNODB) { #if (!$this->isInnoDbLargeFilePrefixEnabled()) { # $this->addError($attribute, gT('You need to enable large_file_prefix setting in your database configuration in order to use InnoDB engine for LimeSurvey!')); #} #if (!$this->isInnoDbBarracudaFileFormat()) { # $this->addError($attribute, gT('Your database configuration needs to have innodb_file_format and innodb_file_format_max set to use the Barracuda format in order to use InnoDB engine for LimeSurvey!')); #} $nothing = "Nothing"; }
I just commented not to make these checks.
Fix this, the following error: Database Connection error!
I notice that "$this->dblocation", when the port is specified, It brought port information in the host parameter, getting "{host=host:port}".
To Fix it, I edited the file".application/models/InstallerConfigForm.php" and made the following corrections:
Where was:
Code:
private function getMysqlDsn() { $port = $this->getDbPort(); // MySQL allow unix_socket for database location, then test if $sDatabaseLocation start with "/" if (substr($this->dblocation, 0, 1) == "/") { $sDSN = "mysql:unix_socket={$this->dblocation}"; } else { $sDSN = "mysql:host={$this->dblocation};port={$port};"; } if ($this->useDbName) { $sDSN .= "dbname={$this->dbname};"; } return $sDSN; }
I changed to:
Code:
private function getMysqlDsn() { $port = $this->getDbPort(); $host = $this->getHost(); // MySQL allow unix_socket for database location, then test if $sDatabaseLocation start with "/" if (substr($this->dblocation, 0, 1) == "/") { $sDSN = "mysql:unix_socket={$this->dblocation}"; } else { $sDSN = "mysql:host={$host};port={$port};"; } if ($this->useDbName) { $sDSN .= "dbname={$this->dbname};"; } return $sDSN; }
Creating the function:
Code:
/** * Get the host * @return string */ public function getHost() { if (strpos($this->dblocation, ':') !== false) { $pieces = explode(':', $this->dblocation, 2); if (isset($pieces[1]) && is_numeric($pieces[1])) { return $pieces[0]; } } return $this->dblocation; }
This way, I was able to proceed and complete the installation.
I believe that this code must be reviewed by the developers to correct this and other erros.
Then, share the workaround.
Regards.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13597
- Thank you received: 2487
3 years 11 months ago #197506
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Error to Install LS 4.1.17 with MySQL 8 and InnoDB.
There are something really great to check code update. It's git.
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The following user(s) said Thank You: wpfan2099
The topic has been locked.
- wpfan2099
- Offline
- Senior Member
Less
More
- Posts: 70
- Thank you received: 3
3 years 4 months ago #208510
by wpfan2099
Replied by wpfan2099 on topic Error to Install LS 4.1.17 with MySQL 8 and InnoDB.
dear LeandrOsBr. dear Denis,
i have issues in installing the limesurvey - in fact i allways get stuck in db connectoin
with the the newest version 4.xy
with the the LTS version 3.xy
the issue allways - i cannot connect to the database:
it limesurvey dones not take the internal php driver to connect to the db then it ought to take the raw socket
#
there is no other option.
where to do the corrections - so that i get the connedtion ot the db-server!?
look forward to hear from you
reagards
i have issues in installing the limesurvey - in fact i allways get stuck in db connectoin
with the the newest version 4.xy
Code:
/umfrage/index.php?r=installer/database Database creation Database doesn't exist! The database you specified does not exist: LimeSurvey can attempt to create this database for you.
with the the LTS version 3.xy
Code:
/survey/index.php?r=installer/database Database configuration Please enter the database settings you want to use for LimeSurvey: Please fix the following errors: Try again! Connection with database failed. Reason: SQLSTATE[HY000] [2002] No such file or directory
the issue allways - i cannot connect to the database:
it limesurvey dones not take the internal php driver to connect to the db then it ought to take the raw socket
#
there is no other option.
where to do the corrections - so that i get the connedtion ot the db-server!?
look forward to hear from you
reagards
The topic has been locked.
- wpfan2099
- Offline
- Senior Member
Less
More
- Posts: 70
- Thank you received: 3
3 years 4 months ago #208540
by wpfan2099
Replied by wpfan2099 on topic Error to Install LS 4.1.17 with MySQL 8 and InnoDB.
well perhaps this is a solution:
i have issues in installing the limesurvey - in fact i allways get stuck in db connectoin
with the the newest version 4.xy
with the the LTS version 3.xy
the issue allways - i cannot connect to the database:
it limesurvey dones not take the internal php driver to connect to the db then it ought to take the raw socket
#
there is no other option.
where to do the corrections - so that i get the connedtion ot the db-server!?
look forward to hear from you
reagards
PS; the issue allways - i cannot connect to the database:
it limesurvey dones not take the internal php driver to connect to the db then it ought to take the raw socket
/var/run/mysql/mysql.sock
there is no other option.
the question is: do we really need to have this as a the minimum set of requirements:
manual.limesurvey.org/Installation_-_Lim...rvey_on_your_website
Minimum 250 MB disk space.
MySQL 5.5.3 or later OR Microsoft SQL Server 2005 or later OR Postgres 9 or later.
Minimum PHP 7.0 or later; however, we recommend PHP 7.4 with the following modules/libraries enabled:
mbstring (Multibyte String Functions) extension library.
PDO database driver for MySQL (pdo_mysql or pdo_mysqli) or Postgres (pdo_pgsql) or MSSQL (pdo_sqlsrv for Windows and pdo_dblib for Linux).
Also, we assume in general that all PHP default libraries are enabled
hash
session
openssl or mcrypt
fileinfo
etc …
at least this thread seems to point this out:
CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2002]
cf
forums.limesurvey.org/forum/installation...-sqlstate-hy000-2002
look forward to hear from you
i have issues in installing the limesurvey - in fact i allways get stuck in db connectoin
with the the newest version 4.xy
Code:
/umfrage/index.php?r=installer/database Database creation Database doesn't exist! The database you specified does not exist: LimeSurvey can attempt to create this database for you.
with the the LTS version 3.xy
Code:
/survey/index.php?r=installer/database Database configuration Please enter the database settings you want to use for LimeSurvey: Please fix the following errors: Try again! Connection with database failed. Reason: SQLSTATE[HY000] [2002] No such file or directory
the issue allways - i cannot connect to the database:
it limesurvey dones not take the internal php driver to connect to the db then it ought to take the raw socket
#
there is no other option.
where to do the corrections - so that i get the connedtion ot the db-server!?
look forward to hear from you
reagards
PS; the issue allways - i cannot connect to the database:
it limesurvey dones not take the internal php driver to connect to the db then it ought to take the raw socket
/var/run/mysql/mysql.sock
there is no other option.
the question is: do we really need to have this as a the minimum set of requirements:
manual.limesurvey.org/Installation_-_Lim...rvey_on_your_website
Minimum 250 MB disk space.
MySQL 5.5.3 or later OR Microsoft SQL Server 2005 or later OR Postgres 9 or later.
Minimum PHP 7.0 or later; however, we recommend PHP 7.4 with the following modules/libraries enabled:
mbstring (Multibyte String Functions) extension library.
PDO database driver for MySQL (pdo_mysql or pdo_mysqli) or Postgres (pdo_pgsql) or MSSQL (pdo_sqlsrv for Windows and pdo_dblib for Linux).
Also, we assume in general that all PHP default libraries are enabled
hash
session
openssl or mcrypt
fileinfo
etc …
at least this thread seems to point this out:
CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2002]
cf
forums.limesurvey.org/forum/installation...-sqlstate-hy000-2002
look forward to hear from you
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11639
- Thank you received: 2737
3 years 4 months ago #208541
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Error to Install LS 4.1.17 with MySQL 8 and InnoDB.
Have you checked if the database driver for MySQL is installed on the server and up and running? Check your PHP info for pdo_mysql or pdo_mysqli.
To me it sounds that LS can not connect to your MySQL database and the missing driver might be a reason. Not an expert though.
To me it sounds that LS can not connect to your MySQL database and the missing driver might be a reason. Not an expert though.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.
- wpfan2099
- Offline
- Senior Member
Less
More
- Posts: 70
- Thank you received: 3
3 years 4 months ago #208550
by wpfan2099
Replied by wpfan2099 on topic Error to Install LS 4.1.17 with MySQL 8 and InnoDB.
hi there
checked the settings - see here
PDO
pdo_mysql
checked the settings - see here
PDO
Code:
PDO support enabled PDO drivers sqlite, mysql
pdo_mysql
PDO Driver for MySQL enabled
Client API version mysqlnd 7.4.11
The topic has been locked.