How do I connect to my cPanel MySQL server via SSH?

All web hosting customers who currently have a web hosting account are limited to a jailed shell access, or more commonly known as "Jailed Shell" access. The only difference between "Jailed Shell" and "Bash" is that with Jailed Shell you are limited to your own home folder, rather than having access to the whole server. Either way, this will not impact your ability to connect to the MySQL server locally, regardless of web hosting account type. However, sometimes you need to connect locally to MySQL, because of the way that cPanel has MySQL configured. An error you might face would be:

"ERROR 2002 (HY000): Can't connect to local MySQL server though socket"

If you encounter this MySQL hosting connection issue, please use the below mentioned workaround, which will allow you to get connected:

"mysql –u cPanel_user –h –p"

However, if you continue to experience problems getting connected to your MySQL server, please feel free to get in contact with your cPanel/WHM web hosting support group, so we can work on getting this issue resolved.