Cloudflare and MySql

I have my own server + cloudflare. Cloudflare redirects to my server and it is working fine.
Now I want to connect with my Visual Basic program trough Cloudflare to my MySql server.

It looks like it can connect somehow but I alway get a Reading from the stream has failed error.
I’ve already disabled ssl and set the port to my mysql server to 8080.

(It works to directly connect to my vps - without cloudflare. Using cloudflare i get this error)
“Reading from the stream has failed”

How can I fix that.

Cloudflare only proxies HTTP/S traffic, regardless of port. It’s like trying to reconfigure your server to put FTP on Port 8080. Cloudflare won’t pass that protocol through.

One option would be to just configure your database connection to use IP address.

Yes I connect to my database with Ip adress but I had issues since people were ddos my mysql server.

Now I tried to “hide” the ip by using cloudflare as proxy.

So it isn’t possible to connect to the server trough cloudflare?

Only on an Enterpri$$$$e plan.

Can’t you firewall off your server to only let specific IP addresses connect to it for that port?

Idk if I am able to do that since many people are connecting to it and the server is my local raspberry.
So i have to search in my router options if I am able to only allow certain ips.

1 Like

You can also filter the IPs in you raspberry. Something like iptables or ufw should do the trick.

Another thing you could do is restrict you database users to specific IPs

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.