EPaz
EPaz

Reputation: 95

Restart to default XAMPP or get access for user 'root'@'localhost after changing password

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.

Upvotes: 1

Views: 21103

Answers (3)

xiom2
xiom2

Reputation: 1

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/

Upvotes: 0

Huseyin
Huseyin

Reputation: 1527

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';

Upvotes: 0

EPaz
EPaz

Reputation: 95

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

Upvotes: 1

Related Questions