how to reset root password in phpmyadmin using xampp server - mysql

HI Any one can help me that how i can reset my phpmyadmin root password.
when i am going to open localhost/phpmyadmin i got this error..
"
Your configuration file contains settings (root with no password) that correspond to the default MySQL privileged account. Your MySQL server is running with this default, is open to intrusion, and you really should fix this security hole by setting a password for user 'root'. "
and when i click on user to change my password i face this error
Error : Token mismatch
I also try this method:
After started XAMPP server, i go to the browser and type the URL localhost/security/ (incase you've modified XAMPP server port, you need to include that port number also in previous URL). The security page will be shown where you can change the root password for MySQL. This will update the phpMyAdmin config also.
i have follow this method but i cannot solve my problem plz help me out this problem

Go to \xampp\phpMyAdmin\config.inc.php
then
$cfg['Servers'][$i]['password'] = 'WhateverPassword';//near line 21
or Run this command
mysqladmin.exe -u root password 'WhateverPassword'
And Possible Duplicate of Resetting MySQL Root Password with XAMPP on Localhost

Related

Access denied for user error during install phpmyadmin

I want to install phpmyadmin on Ubuntu 20.04. I take the password 2 times (first I tryed root password but after I tryed leave the field empty or use other password). Any time I error like screen of my error. I found this tutorial.
Author of this article wrote:
From the prompt, run the following command to disable the Validate
Password component. Note that this won’t actually uninstall it, but
just stop the component from being loaded on your MySQL server:
But this component is disable and yet I still have this error. How can I solve my problem
The error message you posted is different from the Validate Password one in the tutorial. I suggest re-enabling the option that you disabled.
Your error is showing that you (or someone) has changed the password of the MySQL user that Ubuntu (and Debian) uses for administrative purposes (debian-sys-maint). Details of that user are documented in README.Debian and the password is stored on disk in /etc/mysql/debian.cnf.
To resolve this, you can simply set the password to a known value and edit the configuration file to tell your system the new password.
Presumably, you're using MySQL 8.0.20, in which case you would connect through the command line client (mysql -u root -p) and run a command like this: ALTER USER 'debian-sys-maint'#'localhost' IDENTIFIED BY 'aReallyComplexPassword';.
On the chance that you're using MariaDB, the command is SET PASSWORD FOR 'root'#'localhost' = PASSWORD('aReallyComplexPassword');.
You won't need the password again after you put it in /etc/mysql/debian.cnf). Note that you'll need to edit the debian.cnf file as root or sudo.

Can't connect to MySQL using SequelPro

I have recently installed MySQL 5.7.16 on an iMac running El Capitan. I had a few minor hiccups initially because I forgot the root password but that has now been reset and I can now log into MySQL as root user using:
$ mysql -u root -p
However, when I try to connect to MySQL server as root using SequelPro, I get the message:
Unable to connect via the socket, or the request timed out.
Double-check that the socket path is correct and that you have the necessary privileges, and that the server is running.
MySQL said: Your password has expired. To log in you must change it using a client that supports expired passwords.
When I look in /tmp folder, I was expecting to find mysql.sock but, instead, there is a file called mysql.sock.lock. Could this be causing the problem? I can't find where that .lock file has come from and I'm not sure what to do about it. Any help would be appreciated.
I'm not entirely sure what happened to cause the root password to expire but something had thrown a spanner in the works. Anyway, the solution for me was to log into MySQL from the Terminal using:
$ mysql -u root -p
...and then alter the root user's password using:
> ALTER USER 'root'#'localhost' IDENTIFIED BY 'NewPass';
That seemed to do the trick. I was then able to log in to MySQL using Sequel Pro with no problems.
Instead of using a socket connection, you could try connecting via Sequel Pro's standard connection using 127.0.0.1 as the host.
Thus spake the 5.7 docs:
The installation process creates only a single root account, 'root'#'localhost', automatically generates a random password for this account, and marks the password expired. The MySQL administrator must connect as root using the random password and assign a new password. (The server writes the random password to the error log.)
So, connect from terminal and change the root password.
Either your first password may not have been saved OR it just truly never persisted.
For me it was the sudo /usr/local/bin/mysql_secure_installation that may not have ever persisted the password correctly. Since your first password never changed, there is no password or ,like your error said, "expired" to nothing.
Run or rerun the code above, don't type anything for the password field and follow the steps, from the preloaded setup program.

MAMP MySQL Cannot connect: invalid settings.

I've run into a issue in my MAMP instillation, I didn't change anything it just happened. I start MAMP perfectly fine and it gives the green light that the MySQL server is up and I can connect to it from the terminal using the mysql command. However when I try and open phpMyAdmin I get this error:
Error
MySQL said: Documentation
Cannot connect: invalid settings.
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.
I didn't change the default username and password and have subsequently tried to reset them to root and root which is what phpMyAdmin thinks they are. However I still get this error. The host is still set to localhost. I've tried uninstalling and reinstall MAMP to no avail.
Change these two lines in config.inc.php file.
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['port'] = '8889';
This should solve the problem.
Seems like a lot of people where having this error recently.
MAMP had changed the PHP toggle in the preferences pane to 7.0.8, just had to switch it back to 5.6.10.
You need to reset the mysql password for mamp.
I found that tech-otaku explains it well.---https://www.tech-otaku.com/local-server/resetting-mamp-mysql-root-user-password/
What he basically says in the link: Stop the servers. Then using the terminal:use the skip-grant-tables command, then --skip-networking command, and flush privileges command. He goes into more detail for the steps on his website.
P.S- You can also stop the mysqld server from the activity monitor. Applications/utilities/activitymoniter (search:mysql)
Find default mysql host, root and password using mamp on mac
I got this error too. I followed the path below to find out the default root, host and password information.
/Applications/MAMP/bin/mamp/index.php
*my $source = 'DBI:mysql:database=test;host=localhost;
my $user = 'root';
my $password = 'root';*
$db = new mysqli("localhost", "root", "root", "MyDatabaseName");

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

I installed xampp,but when I tried to run it I got an error as thus:
Error
MySQL said: Documentation
1045 - Access denied for user 'root'#'localhost' (using password: NO)
Connection for controluser as defined in your configuration failed.
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.
I tried to search on internet for a solution, but I still can't fix my problem. I have already checked whether I used a password or not in config.inc.php file but i have not used any password.Also, when i try to access with a password, I still can't solve this problem.
I hope anyone can help me. .thank you
I had this problem after changing the password for the root user in phpMyAdmin. I know nothing about programming but I solved it by doing the following:
Go to file C:\wamp\apps\phpmyadmin3.2.0.1\config.inc.php (I guess you would replace "wamp" with the name of your server if you're not using Wamp Server)
Find the line $cfg['Servers'][$i]['password']='' and change this to
$cfg['Servers'][$i]['password']='NO'
Try opening phpMyAdmin again, and hopefully the message will now read "Access denied for user 'root'#'localhost' (using password: YES)
Now change the password in the above line to 'yourpassword' (whatever you had set it to before)
Try this:
Open config.inc.php file in the phpmyadmin directory
Find line 21: $cfg['Servers'][$i]['password'] = '';
Change it to: $cfg['Servers'][$i]['password'] = 'your_password';
Restart XAMPP
Reference
Go to the file C:\wamp\apps\phpmyadmin3.2.0.1\config.inc.php
Find the line $cfg['Servers'][$i]['password']='' and change it to
$cfg['Servers'][$i]['password']='root'
where root is the name of the password you had set in this instance
Hope this helps somebody.
Step one: Go to...
C:\xampp\phpMyAdmin
Step Two: Open the config.inc.php file
Step Three: Locate the following information and change the password.
/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'ENTER_YOUR_USER_NAME_HERE';
$cfg['Servers'][$i]['password'] = 'ENTER_YOUR_PASS_HERE';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = '';
Here's the solution to getting the 1045 Access denied for user 'root'#'localhost' (using password: NO) in phpMyAdmin.
First here's what happens:
The problem occurs when you change over from using phpMyAdmin with no password and mysql with no root password. You change root in mysql to having a root password. You dutifully change phpMyAdmin's config.ini.php file's $cfg['Servers'][$i]['password']='' line to include your password and restart everything you can find, but phpMyAdmin still can't get through.
The reason is that your browser still contains cookies for phpMyAdmin and those cookies reflect not needing a password to access mysql.
The solution:
Clear out the cookies relating to phpMyAdmin. Its browser specific, but in my Firefox, its under Tools > Page Info > Cookies.
You might need to relog in with phpMyAdmin or use the signon.php script (under /examples in my WAMP install).
Try this:
1. xampp/htdocs/xampp/cds.php
change line 4 to: mysql_connect("localhost","root","enter password here");
change line 64 to: if(!mysql_connect("localhost","root","enter password here"))
From here
reset your mysql password on xampp security page.
restart your mysql service and then access the phpmyadmin page using your password. i tried it. this is working fine for me.
I'm using Linux Mint 18.2 of this writing. I had a similar issue; when trying to load myphpadmin, it said: "1045 - Access denied for user 'root'#'localhost' (using password: NO)"
I found the file in the /opt/lampp/phpmyadmin directory. I opened the config.inc.php file with my text editor and typed in the correct password. Saved it, and launched it successfully. Profit!
I was having problems with modifying folders and files, I had to change permission to access all my files in /opt/lampp/ directory. I hope this helps someone in the future.
I'm afraid there's a conflict with the port number(80). Make sure you don't run some software like Skype that use the same port 80
I think to troubleshoot your problem you should try the following:
Check whether the MySQL service is running (Control Panel --> services)
Use a MySQL client like SQLYOG to check whether you are able to connect to MYSQL Server with the username and password you are using in your code.
Just try a sample php program, which fetches the data from table
Ex. http://www.anyexample.com/programming/php/php_mysql_example__display_table_as_html.xml
1045 - Access denied for user 'root'#'localhost' (using password: NO)
solution:
Step 1: Open Location of you wamp/xampp
Step 2: Go to phpmyadmin
Step 3: Open config.inc.php
Step 4: Change the password to the password set for the MySql server and not anything else in this: $cfg['Servers'][$i]['password'] = ''
Step 5: Restart all services /restart wamp/xampp.
I had this problem with a fresh install of wamp and using only default settings without setting any passwords. I found an incorrect default setting and I solved it by the following steps:
Go to C:\wamp\apps\phpmyadmin4.1.14 (Your phpmyadmin version# may differ)
open the file config.inc in a text editor
find the line: $cfg['Servers'][$i]['host'] = '127.0.0.1';
change it to $cfg['Servers'][$i]['host'] = 'localhost';
save the file
restart all services in wamp
The problem seems to be that someone forgot to make the server and host match in the configuration files.
Try resetting your password since it seems it has changed you can reset your password by going to
C:\xampp\mysql
and clicking on the resetroot.bat file
Then change in the php config file the password back to blank and you should have access again
Open the config.inc.php file in the WAMP phpmyadmin directory
Change the line ['Servers'][$i]['password'] = ''
to
$cfg['Servers'][$i]['password'] = 'your_mysql_root_password';
Clear browser cookies
Then Restart all services on WAMP
This worked for me.
NB: the password to use has to be the MySQL password.....
My.ini from the file #password and #bind-address="127.0.0.1" are commented change the password to root and uncomment bind-address="127.0.0.1" and from the file cds.php change the
mysql_connect("localhost", "root", ""); to
mysql_connect("localhost", "root", "root");
Stop the Mysql services and try login again it got logged in.
I had this same problem after I dropped the special PhpMyAdmin controluser account from MySQL.
I had to update the config.inc.php file and replace the entries for 'controluser' and controlpass' with 'user' and 'password'.
So my file ended like this:
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password']='123456';
If you are using XAMPP rather than WAMP, the path you go to is:
C:\xampp\phpMyAdmin\config.inc.php
On OSX
I had same difficult, but a figure out a solucition
open terminal
put 'cd /Applications/XAMPP/xamppfiles'
put 'sudo ./xampp security'
then put your root password and answer the questions
Check your MySQL Port number 3306.
Is there any other MySQL Install in your system on same port ?
If any installation found the change the port number to any number between 3301-3309 (except 3306)
user name : root
password : ' ' (Empty)
try to go to Windows services and stop the MySQL service
go to your wamp server and click on "restart all services".
Refrsch your browser

phpmyadmin is denying me access when I try and use it through http://localhost/xampp homepage

I am using a mac laptop running mac os x version 10.5.8 and I need to export a database to an .sql file so I can push it to github for a project. However when I attempt to use phpmyadmin for this through the localhost homepage, when I click on the link it responds with a page with just this error message:
MySQL said:
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.
But it doesn't even prompt you for user information to begin with? is there something I am missing? someone please help
The problem is in your phpmyadmin configuration on the server.
You can see the documentation here: http://www.phpmyadmin.net/documentation/#setup_script
The setting you are looking for is "$cfg['Servers'][$i]['auth_type']" - set this to 'HTTP', and you will be able to input a username and password.
To resolve the above error:-
a) Open Mysql console from the tray of WAMP server
b) It will ask for password(you might have set this password earlier when u installed MySql in your system)(In my case it is admin)
c) Enter admin (press enter)
Now it means your phpmyadmin is assuming no password for your MySql and unable to connect MySql but yor are able to connect your MySql Server by providing password
For this Open config.inc file from the below path
C:\wamp\apps\phpmyadmin4.1.14
And replace this line
$cfg['Servers'][$i]['password'] =’ ’;
to `$cfg['Servers'][$i]['password'] = 'admin';
I hope it will work..
Turn off your Firewall and then connect to phpmyadmin. It should open. Then turn on Firewall again. Worked for me.