I am trying to write a PHP program which should take input from user and match with data placed in MySQL.
I tried to write program using mysqli in php
new mysqli($hostname,$user,$password,$db)
This line does not establish a connection.
Then I changed some user privileges as described in https://askubuntu.com/questions/766334/cant-login-as-mysql-user-root-from-normal-user-account-in-ubuntu-16-04
But even then my PHP code is not connecting with MySQL. What should I do for establishing this connection.
Should I need to change some root permissions ?
ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL);)