Reputation: 7
I have a mariadb installed on my system, and I want to connect it with spring boot using jpa, so I've forgot my port number
Can someone tell me how I can find it in navicate
Upvotes: -1
Views: 425
Reputation: 7124
If you haven't connected to the database using Navicat yet and you don't already have the port, then there's no way you can find out the port from Navicat.
If you are currently connected to the database through Navicat, simply click the connection tab
and you'll be shown with this dialog
Then you can see the port. Even if you're not using Navicat, most tools that I know of will always need a specific port for the database connection so if you ever save the connection info on the tools, and the port is unchanged, then you can find it there.
If you're using Windows, you can try this method:
a. Make sure the database service is running then open task manager > go to "details" tab and find process name "mysqld.exe" :
if you have multiple process, note down all of the "PID" numbers.
b. Open Command Prompt (as administrator if required) then type the following netstat -aon | findstr "PID"
then press "Enter"; for example, the "PID" is 2668
so like this:
You might get result of two or more rows depending on the connection made to your database but the port will all be the same. In that example, the port is 4238
, that is beside the word TCP
:
Protocol | Local Address (local IP:port) | Foreign Address | State | PID |
---|---|---|---|---|
TCP | 0.0.0.0:4238 | 0.0.0.0:0 | LISTENING | 2668 |
[mysqld]
and [client]
section. Both should have the same port but depending on your MariaDB version, the information might not be the same as this screenshot:Additional:
IF somehow you are connected to the database through a tool (like Navicat) and able to run query but (strangely) unable to check the connection properties, then you can execute this query to get the database port number: SHOW VARIABLES LIKE '%port%';
Upvotes: 0