Step 3: PhpMyAdmin & Database Setup

This solution relies on a MySQL Database, so let's set it up!

I am assuming that you have phpMyAdmin set up, alongside PHP5. If not, click here for an Instructable on how to do this.

Firstly, download the sql file from here.

Login to your phpMyAdmin control panel, then press the "Import" button on the top bar.
Now, under the "File to Import" heading, click the "Choose File" button, and select the file you downloaded previously (gpio.sql).
Finally, at the bottom of the page, click the "Go" button.

This will set up all of the tables needed to ensure the the script functions as it should on your Raspberry Pi.

Now, you need to add a user to the database from within phpMyAdmin. To do this;
Click the "Users" button on the top bar.
Now click the "Add User" link (about half way down the page on the left).
In the "User name" field, enter a suitable username. I went with "gpio".
In the "Host" field, enter "localhost".
Then in the two password fields, enter a suitable password. (No spaces, Hypehens or special characters). I went with "pr03ND2".
Now leave all of the rest as default, then click the "Add User" button on the bottom right.

The final part for this step is to give the user the correct privileges.
Click the "Users" button on the top bar, then scroll down until you see the user you have just added in the "Users Overview" table.
Across from the username, click the "Edit Privileges" link.
Scroll down to the heading "Database-specific privileges" and select "gpio" from the drop down list box, and click the "Go" button.
Select ALL of the check boxes, then click the "Go" button on the bottom left.

Congratulations - That's the database set up.
Remove these adsRemove these ads by Signing Up
matthias2t3 months ago

Hi !

Thanks for the tutorial for doomies (as I am), but...

How would it be with Sqlite?

sdobbie1 year ago
I got into it and tried the web address but it says that The requested URL /admin/phpMyAdmin/index.php was not found on this server.
raptor7s2 years ago
The latest version of phpmyadmin does not have a "users" button.
To add a user, select privileges and half way down the page is an add users selection.