Unfortunately, MySQL has changed client libraries licenses from LGPL to GPL which means that any application linking with those libraries statically or dynamically becomes a derivative work. Therefore, you cannot use MySQL client libraries (that are used to access MySQL server) in non-FOSS applications unless you purchase a license for that. A FOSS here stands for Free & Open Source. A list of FOSS licenses recognized by Oracle, the owner of MySQL, can be found here.
However, you can use ODBC to access MySQL without distributing any MySQL libraries etcetera, so client is responsible for that and have to decide whether to use Open Source or commercial MySQL license, which does not obligate you to purchase any licenses or distribute your software under FOSS license recognized by Oracle. Read this article for more details.
Another interesting part about GPL is that it states that application that links to a GPL library is a derivative work. It means that if you will make a minimalistic open source application that links to MySQL client libraries and communicates with MySQL server, defines an API interface and dynamically loads your commercial/closed-source library which will export only that defined API implementation, you will not violate license terms and conditions because in that case open source application will be a user of closed-source product. The same approach is used by commercial graphics drivers (like NVidia) and audio codecs (like MP3).