First read the JetBrains doc for linux here at https://www.jetbrains.com/help/datagrip/how-to-connect-to-mysql-with-unix-sockets.html#step-5-create-a-connection-to-the-mysql-server
- download the driver files from https://github.com/kohlschutter/junixsocket/releases/tag/junixsocket-parent-2.3.4
- load the files into Drivers
- find the Local WP App's mysql.sock file from the app window: Local Sites > SITE > Database > Socket
- Put the file path of mysql.sock in DataGrip > Data Source > Drivers > MySql Socket > Advanced > junixsocket.file