It can be a bit painful to get the database connection started from your PHPStorm IDE to your MySQL database.
この記事では、PhpStorm からMySQLに接続する方法を紹介します。 PhpStormはデータベースクライアントとしての機能も備えており、各種データベースに接続することができます。. PhpStorm is also available as a snap package. If you’re on Ubuntu 16.04 or later, you can install PhpStorm from the command line. Sudo snap install phpstorm -classic.
As a quick hint, this is where it went wrong with mine:
- MySQL wasn’t listening for incoming connections on the network (change directive bind-address to 0.0.0.0
in /etc/mysql/my.cnf and restart MySQL) - My database user was only allowed to connect from localhost
Edit the file /etc/mysql/my.cnf to configure MySQL to listen for incoming database connections from the network:
Phpstorm Phpcs
Then I added a new user (dbuser) which is allowed to connect from my workstation (workstation.i2s.nl):