Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySQL Dump error on some Hosting privider #25191

Open
Torgalide opened this issue Jun 25, 2023 · 4 comments
Open

MySQL Dump error on some Hosting privider #25191

Torgalide opened this issue Jun 25, 2023 · 4 comments
Labels
Bug This is a bug (something does not work as expected)

Comments

@Torgalide
Copy link

Torgalide commented Jun 25, 2023

Bug

Sorry for my english.

Error when using MySQL Dump on some hosting provider.
Issue is from the argument "--protocol=tcp".
In /htdocs/core/class/utils.class.php line 298, the condition "if (!empty($dolibarr_main_db_port))" will never be empty.
If no value is put in conf.php for $dolibarr_main_db_port, it'll be set to 3306 by default so the condition in /htdocs/core/class/utils.class.php line 298 will never be empty.
Only option for now is to manually remove "--protocol=tcp" from line 299 in /htdocs/core/class/utils.class.php.
That resolve the issue but it's not clean.

Environment Version

17.0.2

Environment OS

Linux 4.18.0

Environment Web server

LiteSpeed 8.1

Environment PHP

8.1.18

Environment Database

MariaDB 10.5.19

Environment URL(s)

No response

Expected and actual behavior

No response

Steps to reproduce the behavior

No response

Attached files

No response

@Torgalide Torgalide added the Bug This is a bug (something does not work as expected) label Jun 25, 2023
@novazur972
Copy link

Confirmed with 19.0

@hregis
Copy link
Contributor

hregis commented Feb 27, 2024

@Torgalide @novazur972 @eldy
the problem is in file "filefunc.inc.php" in the line 147

if (empty($dolibarr_main_db_port)) {
	$dolibarr_main_db_port = 3306; // For compatibility with old configs, if not defined, we take 'mysql' type
}

If Mysql or MariaDB use socket connection, the port is 0 and not 3306 !
remove this line and try again to avoid modify "utils.class.php."

@novazur972
Copy link

Ok, works for me. This fix should be applied.
Note that you have to remove $dolibarr_main_db_port line from dolibarr/htdocs/conf/conf.php
Thanks !

@hregis
Copy link
Contributor

hregis commented Feb 27, 2024

@eldy #28482

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is a bug (something does not work as expected)
Projects
None yet
Development

No branches or pull requests

3 participants