Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP

Mayur Pande
PLUS
Mayur Pande
Courses Plus Student 11,711 Points

XAMPP database not working on Linux properly

So I have started using Linux for development and installed XAMPP on it. Which seems to work fine for normal .php files. However I have used a site which includes a connection to a db and I seem to get the error;

Warning: mysqli_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES) in /opt/lampp/htdocs/Tut/src/provider/TutorServiceProvider.php on line 13

But this is strange as when I run this command below in the command prompt I am able to access the database and see the tables and so on.

mayurpandeuk@ubuntu:~$ mysql -u root -p
Enter Password:

this then gives me;

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 934
Server version: 5.5.47-0ubuntu0.14.04.1 (Ubuntu)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> USE londontutors;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

However I still get the problem when trying to view the site on the browser. It worked fine when using it in the windows environment so not sure what is going on. I also noticed that the phpMyAdmin is not letting me login with the password as well.