Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unknown MySQL server host

Tags:

People also ask

How do I find my MySQL host?

By default your MySQL host is localhost. You can find it in Hosting → Manage → MySQL databases section: If you are setting up a Remote MySQL connection, the host will be different and you will need to check it in the hPanel.

What is the hostname of MySQL server?

As you could see, the MySQL server hostname is Localhost. Localhost means the MySQL database is running on the same server as the website.


When trying to connect to my database server, i encounter the problem of unknown host:

Warning: mysqli::mysqli() [mysqli.mysqli]: (HY000/2005): Unknown MySQL server host 'xxxxxxxxxxxxx:port' in index.php on line 18 

the line 18 is that line where i try to request to connection the the MySQL server:

    $this->db = new mysqli($db_host, $db_user, $db_psw, $db_name); 

I host my database on the 1&1 website hosting company.