MySQL Says: Cannot connect: invalid settings

2019-02-17 10:21发布

We are using XAMPP in a shared environment in our local network. All the projects had the default mysql username and password. Recently I tried to change the user name and password of a project. And now I am not being able to access phpmyadmin. It just displays the following message:

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.

Now no one is able to access the phpmyadmin. How can I solve this?

10条回答
Melony?
2楼-- · 2019-02-17 10:22

For my case it seems the mysql server crashed, while it was it running state without any special thing happened. My web app was connected to the db server and was ideal for long time. I was trying to open the phpmyadmin and it started to give issues(same errors mentioned in the question) while connecting to db. After 5 mins I found my db crashed and not at all starting even after trying lot of things.

查看更多
太酷不给撩
3楼-- · 2019-02-17 10:22

uninstall the xampp and reinstall it in differnt folder. but before uninstalling it please save the documents of 'htdocs' to the other location and after installing put ur data back to new "htdocs" folder

查看更多
虎瘦雄心在
4楼-- · 2019-02-17 10:26

In my case it was just because I had forgotten to turn on the 'MySQL' service on the XAMPP control panel. *facepalm*

查看更多
趁早两清
5楼-- · 2019-02-17 10:27

Remove all lines with $cfg['Servers'] , and keep ONLY the $cfg['Servers'][$i]['host']

查看更多
相关推荐>>
6楼-- · 2019-02-17 10:29

I am also getting the same error, and finally found the answer with help of first reply of above post. But that is wrong because this error prone due to changed password so all of need to do this to get resolve it. previous it look like:

" $cfg['Servers'][$i]['password']='';"

after I changed like:

" $cfg['Servers'][$i]['password']='root'; "

The actual reason behind this while installing the XAMMP there is no password but after the that I added password for security. But it did't get updated in config.inc.php so we need to update manually by following above steps.

查看更多
霸刀☆藐视天下
7楼-- · 2019-02-17 10:32

Error:-Connection for controluser as defined in your configuration failed.

solution:- because of in your ubuntu system two mysql server running so get confusion solve this problem stop mysql servert first

  1. open terminal
  2. type command:

    sudo /etc/init.d/mysql stop
    
  3. type command:

    sudo  /opt/lampp/lampp restart
    
  4. open localhost in browser
查看更多
登录 后发表回答