Send Yun sensor data to MySQL on external server

mortonc:
Are the first 3 blocks of code just for setting up the database and installing PHP on the Linux or do they form part of some code I have to use constantly?

Is the. 4th section the file called db.php?
...

Yes.