Skip to content

Instantly share code, notes, and snippets.

@akhileshdarjee
Last active April 13, 2022 08:34
Show Gist options
  • Save akhileshdarjee/c2fcd09a1381dd3342f2e6c0d5bbf043 to your computer and use it in GitHub Desktop.
Save akhileshdarjee/c2fcd09a1381dd3342f2e6c0d5bbf043 to your computer and use it in GitHub Desktop.
Setup MySQL password after fresh installation
Set MySQL password after fresh installation:
After fresh installation do not start, restart or stop mysql service. Do not run any commands which will affect MySQL in anyway. Run the below commands as soon as the installation is finished. If the below commands are not working then reinstall MySQL.
1. Login to MySQL
mysql -u root
2. Set Password
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'new_password';
3. Exit
mysql> exit
Note:
Replace 'new_password' with your desired password
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment