I don't get why mysql is so hard to connect...
I'm following some guides to connect to mysql local server on macOS 15 with python3.8
Everywhere it says to use pyodbc
, unixodbc
, and freetds
.
I'm reading all the documents but I can't seem to figure out why I can't make connections to my local mysql server.
(I can connect to mysql with mysql
perfectly fine).
I have MySQL workbench running and I'm reading the values in it. It has:
- Host : my.host.server
- Socket : some.socket
- Port : port_number
- Version : mysql.version
- Compiled For : blah blah
- etc...
I've read some documents and guides and it's telling me that I should make sure that I can connect to my mysql server with tsql -H <yourdbhost> -p <yourdbport> -U <yourusername> -P <yourpassword>
so I try tsql -H my.host.server -p port_number -U <yourusername> -P <yourpassword>
and I'm constantly getting
locale is "en_US.UTF-8"
locale charset is "UTF-8"
using default charset "UTF-8"
Error 20002 (severity 9):
Adaptive Server connection failed
Error 20002 (severity 9):
Adaptive Server connection failed
There was a problem connecting to the server
I read document and it says
"If you get message 20009, remember you haven't connected to the machine. It's a configuration or network issue, not a protocol failure. Verify the server is up, has the name and IP address FreeTDS is using, and is listening to the configured port."
Well,,, What am I doing wrong? Just for sanity check, I also downloaded mysql server thing to make sure my server is actually up and running. I've also tried to stop my server using workbench but it didn't even allow me to do that cause it required some script to be setup in order to shut down...
Also says
"Named instances provide another way for connections to fail. You can verify the instance name and the port the server is using with tsql -L."
so I try to test with tsql -L -H my.host.server
and it just hangs for like 2-3 minute and returns nothing. I try to tsql -L -H my.host.server:port_number
, same thing.
I try to curl my.host.server:port_number
and it's returning me something like sha256 encrypted blah blah not permitted binary stuff.. So I'm suspecting that my host.server is indeed alive.
I'm really stuck now. Sorry if I sounded frustrated.. Any help would be appreciated.
Thanks.