I am trying to change the root password for PhPMyAdmin which has 10.1.13-MariaDB
by typing the following in the SQL tab and hitting on the Go
button:
ALTER USER
'root'@'localhost' IDENTIFIED BY 'mypass'
I get this error:
Error
SQL query:
ALTER USER
'root'@'localhost' IDENTIFIED BY 'mypass'
MySQL said: Documentation
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'USER 'root'@'localhost' IDENTIFIED BY 'mypass'' at line 1
I followed this tutorial on MySQL website:
Create a text file containing the password-assignment statement on a single line. Replace the password with the password that you want to use.
MySQL 5.7.6 and later:
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass'
MySQL 5.7.5 and earlier:
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPass');
Here are some screenshots:
This worked for MariaDB:
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpass')
After you change the password you will see the following in PhPMyAdmin:
which says : mysql said: Cannot connect: invalid settings.
You should open the config.inc.php
file and change the following lines:
/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = '';
To:
/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'newpass';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = false;
$cfg['Lang'] = '';
This file by default is in C:\xampp\phpMyAdmin
directory.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With