localhost means that the client (the Arduino) and the server are the SAME machine. That is NOT the case, is it?
So, your database is NOT on localhost.
You COULD have the controllino send serial data to the PC, and have some application on the PC use that data and write to your database. Or you could use an ethernet or WiFi shield, and have web server software on the PC, with php scripts to handle the GET or POST requests, and write to your database.