I didn't get option to set root password of mysql during installation. Now, I am unable to form instance I am beginner in mysql I have tried reinstallating the software watching youtube still didn't got that option.
Loading
I didn't get option to set root password of mysql during installation. Now, I am unable to form instance I am beginner in mysql I have tried reinstallating the software watching youtube still didn't got that option.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Janarthanan SRank #224 · 11K reputationPosted May 11, 2023, 9:00 PM EDT
Hi Prathap,
Please try this
https://dev.mysql.com/doc/mysql-installation-excerpt/5.7/en/default-privileges.html
Jignesh KumarRank #91 · 22.9K reputationPosted May 11, 2023, 4:36 AM EDT
Hello Pratap,
Please refer this one,
https://dbschema.com/2020/04/21/mysql-default-username-password/#:~:text=The%20default%20user%20for%20MySQL,default%20it%20has%20no%20password.
Tuhin PaulRank #7 · 71.9K reputationPosted May 12, 2023, 11:47 PM EDT
There are a few things you can try if you didn't get the option to set a root password during MySQL installation.
mysql -u root -pWhen prompted, enter a new password for the root user.
4. Use the MySQL Workbench graphical user interface to set a password. To do this, open MySQL Workbench and connect to your MySQL server. In the MySQL Workbench navigation pane, expand the Security folder and right-click the root user. Select Change Password from the context menu. In the Change Password dialog box, enter a new password for the root user and click OK.
Once you have set a password for the root user, you should be able to connect to MySQL using the root user and the password you set.
Mohamed Azarudeen ZRank #297 · 8.5K reputationPosted May 11, 2023, 5:57 AM EDT
Stop the MySQL service:
sudo service mysql stopRestart the MySQL service with the
--skip-grant-tablesoption:sudo mysqld_safe --skip-grant-tables &mysqld --skip-grant-tablesConnect to the MySQL server as the root user without a password:
sudo mysql -u rootmysql -u rootSet the root password using the
ALTER USERcommand:ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';Exit the MySQL client and restart the MySQL service normally:
sudo service mysql startAfter completing these steps, you should be able to connect to your MySQL instance as the root user with the new password you set.