MySQL Connector Security

Does the connector run the queries on the server side? I’m assuming so, since the login details are in the connection string. I just want to know how this process works to make sure the database server is secured as best possible. What are the current best practices regarding the MySQL connector?