PDOException: SQLSTATE[HY000] [3159]

Apache PHP 7.4 SSL Connecting to Linode Cluster Database

I have Apache PHP 7.4 Website and I am Prototyping connecting to Linodes new Cluster Databases. I am not able to connect to the MysQL 8 database.

Erroe Message :
PDOException: SQLSTATE[HY000] [3159] Connections using insecure transport are prohibited while --require_secure_transport=ON

Has anyone been able to solve this issue?

Also this is not a WordPress site or some toher Off the Shelf Application.

Thank you for your help.

3 Replies

PDOException: SQLSTATE[HY000] [3159] Connections using insecure transport are prohibited while --require_secure_transport=ON

So, either stop using --require_secure_transport=ON or set up secure transport on the MySQL port (3306).

-- sw

Everyone. I am using the Linode Database Clusters so --require_secure_transport=ON is requried.

The issue ended up being the options. They were incomplete on myside.

  1. Upgrade to php 7.4 if you can

  2. Create your options witht he following information
    $options = array();
    $options[PDO::MYSQL_ATTR_SSL_CA] = $ca_path;
    $options[PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT] = false;

  3. Make sure the user in mysql is correct. for the Linode Cluster Databases you will need to create your own users for your application. Be sure to give it appropriate accesses.

This is what I can think of now.

If you have any questions on this issue please respond and I will try and answer with what I have found out. Also I will keep this up to date with things I find.

Hey,

I also had the same issues.

Connections using insecure transport are prohibited while --require_secure_transport=ON.

Regarding step 2 of your answer, I don't understand it, what should I do? Let me know. Thank you!

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct