I need to find my MySQL username. When I open the MySQL command line client, it only asks me for my password. I don\'t remember my username. And for connectivity with JDBC, I ne
mysql> SHOW VARIABLES WHERE Variable_name = 'hostname';
+---------------+-----------+
| Variable_name | Value |
+---------------+-----------+
| hostname | karola-pc |
+---------------+-----------+
1 row in set (0.00 sec)
For Example in my case : karola-pc
is the host name of the box where my mysql is running. And it my local PC host name.
If it is romote box than you can ping that host directly if, If you are in network with that box you should be able to ping that host.
If it UNIX or Linux you can run "hostname" command
in terminal to check the host name.
if it is windows you can see same value in MyComputer-> right click -> properties ->Computer Name
you can see ( i.e System Properties)
Hope it will answer your Q.
If you use phpMyAdmin, click on Home
, then Variables
on the top menu. Look for the port
setting on the page. The value it is set to is the port your MySQL server is running on.
Here are the default settings
default-username is root
default-password is null/empty //mean nothing
default-url is localhost or 127.0.0.1 for apache and
localhost:/phpmyadmin for mysql // if you are using xampp/wamp/mamp
default-port = 3306
If using MySQL Workbench, simply look in the Session tab in the Information pane located in the sidebar.