Problem:

Below error encounterred when connecting to remote server in PHP code.

Access denied for user \'root\'@\'192.168.233.163\' (using password: YES)

Solution:

Run below command under root 

Command 1

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

  

where IP is the IP you want to allow to access and USERNAME is the user you use to connect

If you want to allow access from any IP just put % instead of your IP

 

Command 2

FLUSH PRIVILEGES;

  

This command is to make setting take effect.

版权声明:本文为binglong原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/binglong/p/4531021.html