Phpstorm Database : java.sql.SQLException: Communications link failure

前端 未结 3 930
渐次进展
渐次进展 2021-01-19 01:43

I\'m working on a website using JetBrains PHPStorm. I created a database with default settings, when I try to test the connection or connect to the database, this error pops

相关标签:
3条回答
  • 2021-01-19 01:59

    I ran into this issue, and I needed to enable "Allow network access to mysql" for it to work.

    0 讨论(0)
  • 2021-01-19 02:03

    Had the same issue with PHPStorm on MAMP. Checked the port in localhost where MySQL was installed. It was 8889 and not the default 3306. Updating the port fixed the issue for me.

    0 讨论(0)
  • 2021-01-19 02:11

    If you update your port number this issue will be fixed. So I thought it would be helpful if you know the step to find out the port number in which your mysql is installed.

    In your mysql client type following sql query:

    SHOW GLOBAL VARIABLES LIKE 'PORT';
    

    OR use this stackoverflow link

    How to test which port MySQL is running on and whether it can be connected to?

    0 讨论(0)
提交回复
热议问题