Quotes are part of strings as far as MySQL - and all other SQL systems - is concerned. So you can't build a connection string that contains a quote unless you use the sppropriare escape system to insert it as an "embedded character" instead.
Unfortunately, that will depend on the connection type and teh language you are using to connect, and we have no idea about either.
So start here:
mysql connection string password special characters - Google Search[
^] and see which one fits your environment and usage.