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
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
Copyright © 2021 Jogjafile Inc.
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" is2668so 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 wordTCP:Find MariaDB/MySQL service name (or whatever custom service name you gave to it), right click it then select "Properties":
Once the "Properties" dialog open, highlight and drag your mouse to the right (end) at the text below the "Path to executable" area to locate where your "my.ini" file is.
You can just highlight the path where the "my.ini" file, paste in "Run" then click "OK" and the file will be opened:
You can find the port under
[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%';