In PHP programming language there is an open source tool called PhpMyAdmin that handles the administration of MySQL. Access can be denied when access to MySQL is attempted through the root user. Root requires insertion of a password and once that is wrongly entered or is not provided, this issue arises. This can be configured with the help of the PHP tool. The rights of the root user can also be reset at the same time.
Beginners may face problems accessing MySql by the root. This happens when it requires you to enter a password and the user has either entered the wrong one or has not provided one at all. This can be easily configured using the following steps:
Step 2: Through phpMyAdmin/librarires, you should edit config.inc.php.
Where $cfg['PmaAbsoluteUri'] = ''; is displayed, alter the command to $cfg['PmaAbsoluteUri'] = 'localhost/phpmyadmin/';
Step 3: Concerning the server commands, change $cfg['Servers'][$i]['host'] = 'localhost'; to $cfg['Servers'][$i]['host'] = 'Localhost';
To be able to reset the root rights, you should enter the following commands:
mysql> GRANT ALL PRIVILEGES ON *.* TO root@localhost IDENTIFIED BY ' your current password ' WITH GRANT
This section will allow to insert the host's name and user account by default and set them up with the correct password, as allocated to them in the php.ini folder. To do so, use the code below:
Note: It is generally a bad idea to store passwords in this file as any user with PHP access can view it
mysqli.default_pw =' your current password '</ital>