How do I find out my MySQL URL, host, port and username?

前端 未结 10 2132
北恋
北恋 2021-01-29 17:35

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

10条回答
  •  离开以前
    2021-01-29 18:32

    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.

提交回复
热议问题