shelby
June 7, 2024, 10:13am
1
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
nickc
June 7, 2024, 11:16am
2
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
emmtre
June 7, 2024, 11:24am
3
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.
Yeah, I have been using Querious for many years. You could either use Socket or TCP/IP to connect. There are a few more steps involved with TCP/IP. You have to create a user and grant access and find the port number for the site. The easiest way is just to use the Socket path for the site and the correct database credentials. Please see the screenshots below.
Using TCP/IP to connect to Local MySQL databases:
mysql -e "CREATE USER 'root'@'127.0.0.1' IDENTIFIED BY 'root'; GRANT ALL ON *.* TO 'ro…
3 Likes
shelby
June 10, 2024, 3:05am
4
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?
shelby
June 10, 2024, 3:10am
5
shelby:
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
Nick-B
June 11, 2024, 1:26pm
6
Thank you for letting us know @shelby and thank you for the help @emmtre