mysql -u root -pYou get this error: Access denied for user 'root'@'localhost' (using password: NO). You reinstalled MySQL/MariaDB many times but it is still asking for a password. Here is how you can fix this issue: 1/ Log in to MySQL/MariaDB by the root user.
sudo mysql -u root2/ Execute the following command lines
ALTER USER 'root'@'localhost' IDENTIFIED BY 'YOURNEWPASSWORD';
Revisions
- January 6, 2023 @ 12:29:11 [Current Revision] by Sharing Solution
- January 6, 2023 @ 12:29:11 by Sharing Solution
- January 6, 2023 @ 12:28:46 by Sharing Solution
Revision Differences
| January 6, 2023 @ 12:28:46 | Current Revision | ||
|---|---|---|---|
| Content | |||
| Unchanged: For some reason, MySQL/MariaDB stopped giving access to the root user. Uninstalled and reinstalled with Homebrew. Fresh install, fresh tables but when you enter | Unchanged: For some reason, MySQL/MariaDB stopped giving access to the root user. Uninstalled and reinstalled with Homebrew. Fresh install, fresh tables but when you enter | ||
| Unchanged: <blockquote>mysql -u root -p</blockquote> | Unchanged: <blockquote>mysql -u root -p</blockquote> | ||
| Unchanged: You get this error: | Unchanged: You get this error: | ||
| Unchanged: Access denied for user 'root'@'localhost' (using password: NO). | Unchanged: Access denied for user 'root'@'localhost' (using password: NO). | ||
| Unchanged: You reinstalled MySQL/MariaDB many times but it is still asking for a password. | Unchanged: You reinstalled MySQL/MariaDB many times but it is still asking for a password. | ||
| Unchanged: Here is how you can fix this issue: | Unchanged: Here is how you can fix this issue: | ||
| Deleted: | |||
| Unchanged: 1/ Log in to MySQL/MariaDB by the root user. | Unchanged: 1/ Log in to MySQL/MariaDB by the root user. | ||
| Unchanged: <blockquote>sudo mysql -u root</blockquote> | Unchanged: <blockquote>sudo mysql -u root</blockquote> | ||
| Unchanged: 2/ Execute the following command lines | Unchanged: 2/ Execute the following command lines | ||
| Unchanged: <blockquote>ALTER USER 'root'@'localhost' IDENTIFIED BY 'YOURNEWPASSWORD'; </blockquote> | Unchanged: <blockquote>ALTER USER 'root'@'localhost' IDENTIFIED BY 'YOURNEWPASSWORD'; </blockquote> | ||
| Unchanged: | Unchanged: | ||
Note: Spaces may be added to comparison text to allow better line wrapping.
No comments yet.