Skip to content
Advertisement

Server select – MySQL / MariaDB

I have two database servers, MySQL and MariaDB, when I’m trying to connect to my local database on MySQL server, I always get “Connectionfailed: SQLSTATE[HY000] [1049] Unknown database ‘ruff'”. I found out, that my code is connecting into MariaDB server instead of MySQL. I can CREATE and CONNECT to any database on MariaDB.

How can I connect to MySQL server databases?

My code is:

JavaScript

Advertisement

Answer

Adding port number after the localhost solved the problem.

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement