1

Here is the technical information:

XAMP : 7.2.10-0

MacOS High Sierra: 10.13.6

Problem:

I reseted the MySQL/MariaDB Root Password by using the mysqladmin command-line utility:

mysqladmin --user=root password "newpassword"

I know that my password change has been accepted, by attempting to connect to the MySQL/MariaDB server using the mysql command-line client in the same directory.

--user=root --password=newpassword -e "SELECT 1+1"

However, when I try to access myphp, I get

 mysqli_real_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: NO)

I tried different solutions online, but none worked:

  1. MySQL said: Documentation #1045 - Access denied for user 'root'@'localhost' (using password: NO)

I am not able to change in config.inc.php

$cfg['Servers'][$i]['password']='NO'

because I don't have privileges. None of the solutions in the previous post helped

  1. https://dba.stackexchange.com/questions/75002/recovering-mysql-root-password-xampp/119749

Edited my.ini and insert skip-grant-tables below [mysqld] Restart MySQL I am able to get into phpmyadmin; however, I don't have user privileges.

Is there a way to restart to default xampp? I would like to have it like it was before changing the password.

Quer
  • 405
  • 7
  • 16
EPaz
  • 85
  • 1
  • 2
  • 13
  • 1
    Hello @EPaz, have you checked if there's other `MySQL` installed in your machine? That occasionally happens when you have other `MySQLs` or you don't run the `xampp` as admin (in Windows) – Quer Oct 17 '18 at 03:21
  • I don't have another MySQL on my machine, is the first time I am using MySQL and php – EPaz Oct 17 '18 at 03:38
  • 1
    Sorry, I don't have any experience using MAC, basing on what you said `because I don't have privileges` you can try these: https://www.wikihow.com/Open-Applications-With-Root-Privileges-on-a-Mac – Quer Oct 17 '18 at 03:44
  • Ohh also, if you change the pass of your MySQL, try to exit and run (in admin privileges) xampp. – Quer Oct 17 '18 at 03:46

3 Answers3

1

I found a solution to how to restart XAMPP to default:

  1. Delete the XAMPP-VM icon from the Applications folder.
  2. Remove all XAMPP-VM data by deleting the ~/.bitnami folder within your home directory on the OS X host.

I was missing the delete of ~/.bitnami folder, reason why the past changes were saved.

Found at: https://www.apachefriends.org/faq_stackman.html

EPaz
  • 85
  • 1
  • 2
  • 13
0

Login into MySQL using socket authentication.

sudo mysql -u root

or enter terminal by root privileges and run

mysql -u root

Then the following command could be run.

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
Huseyin
  • 1,499
  • 2
  • 25
  • 39
0
root@debian:~# mysql -u root -p
SET PASSWORD [FOR user] =
{
    PASSWORD('some password')
  | OLD_PASSWORD('some password')
  | 'encrypted password'
}enter code here

First, open the terminal through xampp, then after writing username and password, set a new password to '' , that is going to override the previous password and then you can access to mySQL and phpmyadmin.

https://mariadb.com/kb/en/library/set-password/

xiom2
  • 1