Query MySQL database in Unity

I have server’s IP address, username, password, and database name. How can I connect to MySQL database and run a query ? I have read some instructions, they are all making a PHP script on server to handle this, and unity only have to call a URL. But if I can not access server, only provided above information, how can I access the MySQL database. Can I run PHP scripts in Unity ?

No, you’d use PHP to create an interface (probably REST) to the database that is exposed on a web server, and connect to that interface via WWW.