SSL certificate for website and MySQL

I have recently gotten an SSL certificate for my website and have successfully implemented it. The certificate shows up when I go to my website and now I have been trying to set up MySQL within the same server. I know this isn’t the most efficient way but the project I am doing this for is very small scale. I changed the mysql.conf file to bind to I try to login where host is my IP address but it will not allow me. The response is

ERROR 1130 (HY000): Host ‘XXX.XXX.XXX.XXX’ is not allowed to connect to this MySQL server

I went to mysql to check ssl status and I get this

±--------------±----------------+ | Variable_name | Value | ±--------------±----------------+ | have_openssl | YES | | have_ssl | YES | | ssl_ca | ca.pem | | ssl_capath | | | ssl_cert | server-cert.pem | | ssl_cipher | | | ssl_crl | | | ssl_crlpath | | | ssl_key | server-key.pem |

But when I do \s I get “SSL: Not in use”

I’m not sure why it is saying SSL is not in use but I think that is why my secure IP address will not allow access to mysql. Does anyone know how to fix this or what else might be the problem?

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi! That particular error message from mysql doesn’t actually apply to the SSL configuration. If you’re trying to login as the root user then that user is most likely limited to “localhost” connections, eg, from the same server.

If you want to create a user or add mysql privileges to a user, here’s a tutorial on how to do that:

The “@localhost” part of that tutorial is where you would need to put your IP address to allow yourself to connect to the mysql user.

However, I do not recommend this - instead, you can create an SSH tunnel then connect to mysql as if you were on the server itself.

Here’s one DO tutorial using an SSH tunnel and mysql workbench:

There are many options for command line or gui access via the SSH tunnel method.

I would also recommend changing your mysql server to bind to localhost instead of as it will be more secure and will work well with the SSH tunneling method.

Hope this helps, let us know if you have any questions