I can not connect to localwp database from DBeaver

I’m trying to connect to localwp’s site db from DBeaver following this instruction Connect a different database tool - Local
But step 1 does not make sense to me. I don’t know what my remote host and remote port are. Please help
Here is picture of my database info in step 1

System Details

  • Local Version:

  • Operating System (OS) and OS version:MacOS

It looks like DBeaver does not support connection via a socket, @shelby, which is required for Local on macOS and Linux by default.

You could try connecting via IP as described here: How can I connect to MySQL using TCP/IP rather than a socket on macOS/Linux?

Or you can try another database client that supports socket connections, such as TablePlus or Navicat, or the web client built into Local (click “Open AdminerEvo” at the top of the database tab).

3 Likes

I have been using TCP/IP for many years with different database apps and it works great but it requires a few extra steps for each website.

3 Likes

Thanks guys.
I have follow the instruction on using TCP/IP and trying to connect to MYSQL using this PHP script.

<?php
$sourceDbHost = 'localhost';
$sourceDbUser = 'root';
$sourceDbPass = 'root';
$sourceDbName = 'local';
// Connect to source and target databases
$sourceDb = new mysqli($sourceDbHost, $sourceDbUser, $sourceDbPass, $sourceDbName, 10003);

But it still results in this error


What should I do now?

Oh never mind, I changed the host to 127.0.0.1 and it works well now. Thanks so much for your help. It was very helpful

2 Likes

Thank you for letting us know @shelby and thank you for the help @emmtre :green_heart: