interconnectit / Search-Replace-DB

This script was made to aid the process of migrating PHP and MySQL based websites. Works with most common CMSes.
https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
GNU General Public License v3.0
4k stars 855 forks source link

SQLSTATE[HY000] [2005] Unknown MySQL server host 'localhost:3306' (0) #231

Closed ellodave closed 6 years ago

ellodave commented 6 years ago

The name, user, pass and host all match what is in wp-config.php

muyaedward commented 6 years ago

$pdo = new PDO("mysql:host=localhost;dbname=database", 'username', 'password');

M4N0JKUM4R commented 4 years ago

$pdo = new PDO("mysql:host=localhost;dbname=database", 'username', 'password');

What are we supposed to do with that? @ellorich did you find the solution? I am encountering the same problem.

nathabonfim59 commented 3 years ago

What are we supposed to do with that? @ellorich did you find the solution? I am encountering the same problem.

If you are using the default port, remove the ':3306' from your 'new PDO()'.

rdgsolutions commented 2 years ago

Thanks nathabonfim59