skip to Main Content

I created an Azure App Service and enabled MySql in App. I able to connect to MySql using phpMyAdmin from portal – go to app -> MySql in App -> click manage. It open another window with phpMyAdmin.

But somehow now I am not able to connect to database. I get below error

MySQL said: Documentation

2002 – An attempt was made to access a socket in a way forbidden by
its access permissions. — The server is not responding (or the local
server’s socket is not correctly configured).

2

Answers


  1. Check and follow below guidelines:

    1.Locate your config.inc.php file which relates to PHPMyAdmin.

    2.Locate the line $cfg['Servers'][$i]['host'] mostly this line might have been commented out by default, if so please uncomment it.

    3.And replace that line with following:

    $cfg['Servers'][$i]['host'] = '127.0.0.1';

    4.Save it and restart the MySQL Database from your XAMPP control panel.

    5.Change your $host parameter value in the mysqli_connect() method to following:

    `$_connection = mysqli_connect(**"localhost: 3306"**, $_mysql_username, $_mysql_password, $_database);`
    

    Note: This 3306 is my MySQL port number which is its default. You should better check what’s your actual MySQL Port number before going to follow these steps.

    For more details you could refer to this similar issue.

    Login or Signup to reply.
  2. It’s simple.
    If you have stopped the website and started it again, you must connect to the website URL from a browser, before you can use phpMyAdmin.

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