I would like to host a database on my raspberry pi to which I can access from any device. I would like to access the contents of the database using python. 
What I've done so far:

I installed the necessary mysql packages, including apache 2.   
I created my first database which I named test.
I wrote a simple php
    script that connects and displays all the contents of my simple
    database. The script is located on the raspberry pi at /var/www/html
    and is executed when I enter the following from my laptop
    (192.168.3.14/select.php)

Now my goal is to be able to connect to the database using python from my laptop. But I seem to have an error connecting to it, this is what I wrote to connect to it.
db = MySQLdb.connect("192.168.3.14","root","12345","test" ) 
Any help or direction is appreciated.
on the terminal of your raspi use the following command:
mysql -u -p -h --port
where you switch out your hostname with your ip address. since currently you can only connect via local host
Raspberry Pi Database Server