-
-
Notifications
You must be signed in to change notification settings - Fork 213
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
backup option doesn't backup database #4225
Comments
Reason: return error:
but correct connection according my hosting should be:
After hardcoded those 2 values, backup was created: |
This was solved this way before:
|
@Deltik do we need to apply the same fix to the pdo handler? |
@Moc just for backup, connect() works this way. At least I hope and it didn't fall back to mysql connect. |
@Moc: No, the hostname and port are already parsed by the time diff --git a/e107_handlers/e_db_pdo_class.php b/e107_handlers/e_db_pdo_class.php
index 1e73bf01b..511f45690 100644
--- a/e107_handlers/e_db_pdo_class.php
+++ b/e107_handlers/e_db_pdo_class.php
@@ -2455,8 +2455,6 @@ class e_db_pdo implements e_db
// include_once(dirname(__FILE__) . '/Ifsnop/Mysqldump/Mysqldump.php');
- $config = e107::getMySQLConfig();
-
$dumpSettings = array(
'compress' => !empty($options['gzip']) ? Ifsnop\Mysqldump\Mysqldump::GZIP : Ifsnop\Mysqldump\Mysqldump::NONE,
'include-tables' => array(),
@@ -2477,13 +2475,13 @@ class e_db_pdo implements e_db
foreach($tableList as $tab)
{
- $dumpSettings['include-tables'][] = $config['mySQLprefix'].trim($tab);
+ $dumpSettings['include-tables'][] = $this->mySQLPrefix.trim($tab);
}
try
{
- $dump = new Ifsnop\Mysqldump\Mysqldump('mysql:host='.$config['mySQLserver'].';dbname='.$config['mySQLdefaultdb'], $config['mySQLuser'], $config['mySQLpassword'], $dumpSettings);
+ $dump = new Ifsnop\Mysqldump\Mysqldump("mysql:host={$this->mySQLserver};port={$this->mySQLport};dbname={$this->mySQLdefaultdb}", $this->mySQLuser, $this->mySQLpassword, $dumpSettings);
$dump->start($backupFile);
return $backupFile;
} @Jimmi08: Can you try this patch to see if it works for your setup with the custom hostname and port? |
@Deltik I am getting error: This version works (I just replaced $config), but I have no idea what is wrong/different with yours (I checked it, string is correct, db is there): |
e_db_pdo::backup() now supports MySQL servers with custom ports Fixes: e107inc#4225
Bug Description
e107 is not able to backup database on live server
This is localhost:
This is live site:
As you can see SQL file is not created.
Live site:
PHP Version 5.6.40
10.1.38-MariaDB-1~xenial
PDO: Enabled
NO_ENGINE_SUBSTITUTION
Version 2.3.0 (git)
Admin log:
The text was updated successfully, but these errors were encountered: