skip to Main Content

I am trying to connect to Plesk MySQL server from another server. I am trying to access it using IP address But It always gives the error like.

“Can’t connect to MySQL server on ‘xx.xxx.xxx.xx’ (4)”

Remote access setting of MySQL server are .”Allow remote connections from any host”

3

Answers


  1. Here’s the steps to "Allow remote connections from any host" :

    1. Open a DOS command prompt on the server.

    2. Run the following command from the mysqlbin directory:

      {mysql -u root –password=}

    3. A mysql prompt should be displayed.

    4. To create a remote user account with root privileges, run the following commands:

      {GRANT ALL PRIVILEGES ON . TO ‘USERNAME’@’IP’ IDENTIFIED BY ‘PASSWORD’;}

    ‘USERNAME’ is the username to be created.
    ‘IP’ is the public IP address of the remote connection.
    ‘PASSWORD’ is the password to be assigned for this username.
    (IP can be replaced with % to allow this user to logon from any host or IP)

    mysql> FLUSH PRIVILEGES;
    mysql> exit;

    Login or Signup to reply.
  2. Edit /etc/my.cnf and change to (via ssh):

    bind-address = ::
    

    And restart db:

    service mariadb restart
    
    Login or Signup to reply.
  3. Long story short. You can’t. Your provider does not have that featured enabled. Switch to cPanel providers.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search