How to find out the MySQL root password

0 votes
I cannot figure out my MySQL root password; how can I find this out? Is there any file where this password is stored?
Aug 26, 2020 in PHP by kartik
• 37,530 points
903 views

1 answer to this question.

0 votes

Hello @kartik,

Follow these steps to reset password in Windows system

  1. Stop Mysql service from task manager

  2. Create a text file and paste the below statement

         MySQL 5.7.5 and earlier:

         SET PASSWORD FOR 'root'@'localhost' = PASSWORD('yournewpassword');

         MySQL 5.7.6 and later:

         ALTER USER 'root'@'localhost' IDENTIFIED BY 'yournewpassword';

          3.Save as mysql-init.txt and place it in 'C' drive.

           4.Open command prompt and paste the following

            C:\> mysqld --init-file=C:\\mysql-init.txt

Hope it helps!!!
Thank you!!

answered Aug 26, 2020 by Niroj
• 82,780 points

Related Questions In PHP

0 votes
1 answer

How to find the php.ini file from the command line?

Hello @kartik, You can get a full phpinfo() using : php ...READ MORE

answered May 19, 2020 in PHP by Niroj
• 82,780 points
10,042 views
0 votes
1 answer

How to get a list of user accounts using the command line in MySQL?

Hello @kartik, Use this query: SELECT User FROM mysql.user; Which ...READ MORE

answered Aug 17, 2020 in PHP by Niroj
• 82,780 points
195 views
0 votes
1 answer

How to get the sizes of the tables of a MySQL database?

Hello @kartik, You can use this query to ...READ MORE

answered Aug 18, 2020 in PHP by Niroj
• 82,780 points
158 views
0 votes
1 answer

How to export the MySql database structure without the data just the structure?

Hello @kartik, You can do with the --no-data option with ...READ MORE

answered Aug 18, 2020 in PHP by Niroj
• 82,780 points
376 views
+1 vote
1 answer

How to make anchor tag with routing using Laravel?

Hey @kartik, First you have to go to ...READ MORE

answered Mar 18, 2020 in Laravel by Niroj
• 82,780 points
8,552 views
0 votes
1 answer

What is redirection in Laravel?

Named route is used to give specific ...READ MORE

answered Mar 18, 2020 in Laravel by Niroj
• 82,780 points
951 views
0 votes
1 answer

How to install Laravel via composer?

Hello, This is simple you just need to ...READ MORE

answered Mar 23, 2020 in Laravel by Niroj
• 82,780 points
776 views
+1 vote
1 answer

What are named routes in Laravel and How can specify route names for controller actions?

Hey @kartik, Named routing is another amazing feature of ...READ MORE

answered Mar 23, 2020 in Laravel by Niroj
• 82,780 points
9,315 views
0 votes
1 answer

How to remove MySQL root password?

Hello @kartik, You need to set the password ...READ MORE

answered Aug 19, 2020 in PHP by Niroj
• 82,780 points
3,603 views
0 votes
1 answer

How to retrieve or obtain data from the MySQL database using PHP?

Hello kartik,  Actually there are many functions that  ...READ MORE

answered Mar 27, 2020 in PHP by Niroj
• 82,780 points
598 views