connecting to mysql server on another PC in LAN

前端 未结 10 872
[愿得一人]
[愿得一人] 2020-12-09 07:00

I have mySQL setup in a PC on my local network, how do I connect to it? I also have mySQL installed in this computer (which I want to use to connect to the database).

<
10条回答
  •  余生分开走
    2020-12-09 07:26

    You don't have to specify ':3306' after the IP, it's the default port for MySQL.

    And if your MySQL server runs with another port than 3306, then you have to add '-P [port]' instead of adding it to the IP address.

    The MySQL client won't recognize the syntax "host:port", you HAVE to use -P [port] instead.

    And btw, if you use '-p password', it won't work and will ask you the password again. You have to stick the password to the -p : -ppassword. (still, it's a very bad habit, because anyone that could do a PS on your server could see the plain password...)

提交回复
热议问题