Setting up LAMP on raspberry pi 3
Hi
I thought I would post here as I cannot seem to resolve this problem.
I set up my raspberry pi with raspbian and I want to use it as a web server so I can learn php. I have a pi3 and a windows 10 pc. I would like to write php on my PC and then deploy it to the pi and view it through a web browser on my PC.
I installed apache2 and I can view the test page no problem, I installed php and I can view that test page as well. The problem comes when I install MySQL. I wrote a php page that has a connection to the MySQL test database I set up. I created a user against that database and assigned it ALL privileges (not a good idea I know but its just a test). I should say this is at home.
The problem is I cannot get the connection to the MySQL database to work. I used various youtube videos to help me with the installations of the above and they all say just install the packages, create a DB and a user and your done but that's bollocks (hence the name of my page below). I must of re-done the installation about 10 times trying different things along the way.
The error I get is below
Warning: mysqli_connect(): (HY000/2003): Can't connect to MySQL server on '192.168.0.9' (111) in /var/www/html/bollocks.php on line 17
I have edited the bind address as people have stated, I have edited the user permissions but nothing works.
Can anyone offer some advice or links to a guide that actually works.
Posted May 29, 2016, 8:21 PM UTC