PyCharm: configure MySQL DB using "pipe"
Answered
Hi,
I am using a Windows 7 machine as a development platform for the moment. I am running the latest PyCharm and am working on a python/Django project. I have a local instance of MariaDB running but it is NOT using networking. It is accepting connections through a named pipe/socket.
PyCharm keeps prompting me to configure data sources for this project but the MySQL and MaeiaDB dialogues only seem to support hostname and port number options. Is there a way to have Pycharm either accept the named pipe I have setup or have it read the "my.cnf" config file that I have?
Please sign in to leave a comment.
Same thing for PhpStorm: need named pipe connection option for MySQL on Windows 10.
Please read this article , here are the instructions how to make connection with JDBC driver and pipes.
To find socketFactory propertie please go to DataSource properties -> Advanced.
Yuriy, I followed the instructions and now I get an error:
Here are the exact steps I've made:
1. Open the data source's properties
(go to main menu, open View -> Tool Windows -> Database, select the source, press Shift+Enter)
2. In the General tab enter the following URL value:
3. In the Advanced tab find socketFactory property and set it's value to
4. Press Test Connection. Ends up with the error.
You can see all the steps on the screenshots:
I use latest version of PhpStorm (2021.2.3 at the time), latest verison of MySQL Connector/J (8.0.25 at the time) and MySQL Server 8.0.22.
(In the tool window MySQL Server's version somewhy shows up as 5.7.26, which is wrong and likely comes from partially successful connection tries in the past.)
The server instance itself is 100% fine: I connect to it via the pipe with various other clients on a regular basis.
Please try this instruction: https://www.jetbrains.com/help/datagrip/how-to-connect-to-mysql-with-named-pipes.html
I've read the instruction.
Eventually changes I had to make come down to these:
1. Set Host field value to
2. Set URL field value to
(It actually sets up automatically if you clear the field before setting Host value)
I'm still getting the same "[08S01][1043] Bad handshake" error.
(screenshot: https://intellij-support.jetbrains.com/hc/user_images/TUTYS0eHN_O4asyjySFVkA.png)
I've also tried values without (path=\\.\pipe\MySQL) in both fields. Still no good.
Also I wasn't able to complete step 4 of the instruction:
Because there is no such variable in the list (sessionVariables goes immediately after serverRSAPublicKeyFile).
(screenshot: https://intellij-support.jetbrains.com/hc/user_images/XcuipOY8QchkpQqjBRFJ3g.png)
Please set 'Connection type' to 'Unix socket' here
Will this work on Windows 10 machine?
What value should I set the URL field to? It stays the same after I changed the connection type, but it apparently shouldn't be like that.
Yes my bad, it won't work on Windows.
Please try to switch driver to 'MySQL for 5.1' or use any other version of 8.x.
BTW what is the usecase for pipe connection? Don't you want to enable TCP/IP?
No good. Yields whether the same error or even worst ones.
All database server's clients run at the same machine, so there is no need of any network connections.
No, I don't, because it decreases security.
There is actually no reason for that except JetBrains not working properly.
I wonder if there is anyone in JetBrains team who actually does have installation of MySQL server on Windows (standalone, not in Docker) and can reproduce steps I make.
Have you set up MySQL properly to accept piped connections?
Yes, I have.
I connect to it via pipe with various clients: PHP, mysql command line client, MySQL Workbench.
All of them work fine.
Could you share output for
?
I see, it looks like an issue then. Could you file an issue in DataGrip YouTrack?
vasily, done: https://youtrack.jetbrains.com/issue/DBE-15954
Make sure you've configured your MySQL server correctly since I can't reproduce the issue.
Please, follow the instruction https://www.jetbrains.com/help/datagrip/how-to-connect-to-mysql-with-named-pipes.html but skip serverTimeZone section.