How to grant remote access to MySQL for a whole subnet?

前端 未结 7 1791
不知归路
不知归路 2020-12-02 07:50

I can easily grant access to one IP using this code:

$ mysql -u root -p
Enter password:    
mysql> use mysql    
mysql> GRANT ALL ON *.* to root@\'192.         


        
7条回答
  •  忘掉有多难
    2020-12-02 08:17

    You would just use '%' as your wildcard like this:

    GRANT ALL ON *.* to root@'192.168.1.%' IDENTIFIED BY 'your-root-password';
    

提交回复
热议问题