Database connection failed
-
Hello,
I already used Duplicator many time without any problem.
But today, I’m trying to migrate a website on a new dedicated server but I get the error:Database connection failed
Access denied for user :’xxx@localhost’ (using password: YES)Do you have an idea what could be the problem?
My sql server is using socket, could it be the problem?Thanks for your help.
Sam
-
Sorry made a mistake in my first post, the error is:
unknown mysql server host : localhost:/tmp/mysql5.sock
This might be because your host requires a different port number than 3306. This you will need to validate with the hosting provider. If that is the case then the next version has support for port numbers, you can get it by following these instructions:
-> Browse to http://wordpress.org/extend/plugins/duplicator/developers/
-> Look for the section “Other Versions”
-> Click on “Development Version” and download the zip plugin file
-> Uninstall your current version and install this one
-> Note: The version number might still be the same but the source code is different.Hope that helps!
Hi Samkhe,
Did you get past this issue?
Hi
I have the same issue. And i’m sure that i must use port 3307 I downloaded the Development Version, as it was wrote above. but i don’t know where i can change it.Just add the port number to the end of your host.
Example localhost:3307unfortunately it does not work for me, according to the host without a port it show message “DATABASE CONNECTION FAILED! Access denied for user …”
with the specified port: “DATABASE CONNECTION FAILED! Unknown MySQL server host ..”
I’m sure that I gives good data written as a php file for this database connection to work.
I’m not sure if it’s important but the combination created a php file did not work specify the host and port in a way, for example, localhost: 3307 it must be new mysqli (host, user, password, database, PORT)
Sory for my english πIt should work… I have used it several times and so have other people without issues…
The code is written as such:
$db_port = parse_url($_POST['dbhost'], PHP_URL_PORT);Then the value is feed into the mysqli function…
Hope that helps!
Sorry for my late answer.
I found the solution, it worked for me.
I have a tutorial in french that I translated specialy for you on my blog. (look at the end of the page for the english translation)http://www.seo-expert.fr/duplicator/
Hope it can help
Hey Samkhe,
Thanks for that link… I’ll add it to the todo list…
Cheers~
Hi Cory,
I recently found your great plugin and it can prevent a lot of headaches! I have two different host providers, and on one provider it works perfectly, tested it both ways! Really great!
But the other host provider uses a port number (localhost:3351) for the connection to MySQL, and That fails.
I tried your developer version, installed on the source site, and made ββthe packet again with the developper version.
Transferred packet and installer to the target host and tried again with localhost:3351, but failed ;-(
I am sure that all other parameters are good, I am able to access database with the phpmyadmin, and the database server-id and user-id/ password are the same as in the wp-config.php file.So i do not know what to do next. Contacted my hosting provider and thay are looking into it right now.
Hope you have a suggestion?
BertBtw, the link http://www.seo-expert.fr/duplicator/ does not respond anymore… So that could not give me any help either
Cory,
I tried something in your Installer script. Force the script to use the database port number.
I switched off line 525:
// $db_port = parse_url($_POST[‘dbhost’], PHP_URL_PORT);And added at line (525) to use port 3351
$db_port = ‘3351’;
Then the connection test Succeeds, but when I start Run Deployment the script comes again with a database connection failure…
Sorry, I switched off line 524
I noticed a second place where you did the same to collect the database port. line 1188, so i commented this line also and placed on line 1189
$db_port = ‘3351’;But this wasn’t a success either.
Extra info, System Status:
REQUIREMENTS click links for details
Root Directory Pass
Safe Mode Off Pass
MySQL Support Pass
PHP Version: 5.2.17
(PHP 5.2.17+ is required) PassCHECKS
Web Server: Microsoft IIS
OK
Open Base Dir: Off
Good
PHP SAPI: cgi-fcgi
PHP ZIP Archive: Is Installed
CDN Accessible: YesHey deltabert,
Did you check to make sure the mysql user is setup with full permissions and also setup in the hosts table correctly?
The topic ‘Database connection failed’ is closed to new replies.