XAMPP brings it´s own copy of MySQL. Installing the official package only means you now have two MySQL servers instances installed.
So what can happen, depending on configurations is:
- one of the instances of MySQL is not starting/not configured correctly/not with full setup completed;
- OR both are running, and you won't be able to talk with one of them;
- OR you are talking with the wrong instance without realising it.
For now, I do recommend deleting the official package and restarting the MySQL from XAMPP as a quick fix.
As recommendations for a near future:
There are several choices for a PHP framework installation, and two choices concerning this particular question:
- using the official distribution packages of Apache, MariaDB/MySQL, PHP and Perl;
- installing XAMPP.
I recommend the former approach, of using the official packages of the distribution instead of XAMPP for the following reasons:
- it is more standard (even for asking help here);
- the file locations are more standard;
- it is supported by the distribution;
- it also benefits from more regular security updates of the OS;
- on top of that it also gives less problems when upgrading either the MySQL version or the distribution version.
IMO XAMPP is better suited for people running Windows, for people running Linux it is more difficult to maintain updated and is not standard.
root
login password? MySQL maintains its own passwords, independent of the operating system; when you install MySQL, it sets up aroot
account with a blank password. Unless you set a MySQLroot
password and you aren't telling us about it, you should just be typing <Enter> for the password. That said, I agree with digitaladdictions: the "Can't connect" error message makes it look like the server is not running. – G-Man Says 'Reinstate Monica' Apr 7 '16 at 3:46