MySQL: How to allow remote connection to mysql

后端 未结 16 1138
北海茫月
北海茫月 2020-11-21 06:15

I have installed MySQL Community Edition 5.5 on my local machine and I want to allow remote connections so that I can connect from external source.

How can I do that

16条回答
  •  攒了一身酷
    2020-11-21 06:50

    Please follow the below mentioned steps inorder to set the wildcard remote access for MySQL User.

    (1) Open cmd.

    (2) navigate to path C:\Program Files\MySQL\MySQL Server 5.X\bin and run this command.

    mysql -u root -p

    (3) Enter the root password.

    (4) Execute the following command to provide the permission.

    GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'IP' IDENTIFIED BY 'PASSWORD';

    USERNAME: Username you wish to connect to MySQL server.

    IP: Public IP address from where you wish to allow access to MySQL server.

    PASSWORD: Password of the username used.

    IP can be replaced with % to allow user to connect from any IP address.

    (5) Flush the previleges by following command and exit.

    FLUSH PRIVILEGES;

    exit; or \q

提交回复
热议问题