3

This is the error message I got after I tried to make a password and username for localhost and root. Please help me. I am using Mac by the way.

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.

nit21
  • 125
  • 1
  • 4
  • 13
  • This is your answer: https://stackoverflow.com/questions/18022809/how-to-solve-error-mysql-shutdown-unexpectedly – Presta Test Apr 25 '23 at 15:33

3 Answers3

3

go to xampp\mysql\bin\my.ini and open it. change the port to 3307 and go to xampp\phpMyAdmin\config.inc.php and check the name of the host $cfg['Servers'][$i]['host'] = 'localhost:3307';

1

Adding to soufiane's answer above, there is actually 2 more places where you have to make the same change:

  1. xampp window: config > Service and Port Settings > mysql > Change port to 3307
  2. add $cfg['Servers'][$i]['port'] = 3307; to phpMyAdmin\config.inc.php

For a complete start to finish solution, refer to this answer on Quora by Owais R. Mir: https://www.quora.com/How-do-I-change-the-port-of-a-MySQL-server-in-XAMPP/answer/Owais-R-Mir

PS: I used this solution to run mysql from xampp on port 3307 because I had installed mysql separately before and it was using port 3306. When ports are reset for xampp mysql you avoid issues with initializing and signing in to your local database via phpmyadmin.

MIRAU
  • 25
  • 5
1
  1. So , you have to open XAMPP Control Panel --> Click MySql Config- >Click my.ini

  2. You have to write this line skip-grant-tables after [mysqld].

  3. Open xamp folder ->PhpMyAdmin .You will see config.inc.php file in phpMyAdmin folder, just open it with notepad++ $cfg[‘Servers’][$i][‘host’] = ‘127.0.0.1’; This is default port number.

  4. Resolve this issue by manually editing in the file “config.inc.php” located at “C:\xampp\phpMyAdmin”. Write “localhost:3307” <--- Your port PhpMyAdmin within $cfg[‘Servers’][$i][‘host’] = ‘localhost:3307′;<--- Your port PhpMyAdmin

  5. Save this changes. You can find port number as follows: Open XAMP-->config-->service port setting-->mySql.edit port 3307