PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, December 29, 2021

[FIXED] Can not modify config.inc.php

 December 29, 2021     macos, mysql, php, phpmyadmin, xampp     No comments   

Issue

I changed password in phpmyadmin for root (there was no password actually) and now when I go to phpmyadmin, I receive this error:

MySQL said: Documentation

Cannot connect: invalid settings. mysqli_real_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: NO) phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.

I went to config.inc.php to add the password there, but I can't save modified config.inc.php, it shows that I don't have enough permissions to save it.

I went to google and searched for issues. I tried to change permission through terminal with 644, but it didn't work for me.

I even tried to reinstall XAMPP, but I still get the same error.

Now I have phpmyadmin on my computer, which doesn't work at all and I can't change it.

Please help me, how can I fix it?

Also I am using Mac and XAMPP.


Solution

  • Open the Mac command shell.

  • Use the cd command to set the directory to the location of your config.inc.php file.

  • Type the following command:

    sudo nano config.inc.php
    

    You will be asked for your password; enter it. This puts the command into administrator mode.

    This will open the Nano text editor in the command window where you can edit the file. Find the password field (use ctrl+w if you need to search), edit it, and then use ctrl+x to save and exit. You should now be able to use phpMyAdmin again.



Answered By - Spudley
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing