Guest User

Untitled

a guest
Oct 18th, 2018
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. ### Stop MySQL service
  2.  
  3. - You can do that using the preference pane if you have that installed "Preferences" > "MySQL" (at the bottom)
  4. - You can stop it using Terminal `sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop`
  5.  
  6. ### Skipping Access Tables
  7.  
  8. - If you have installed MySQL5, fire up Terminal window and execute `/usr/local/mysql/bin/mysqld_safe --skip-grant-tables`
  9. - For older versions of MySQL, execute the following command `/usr/local/mysql/bin/safe_mysqld --skip-grant-tables`
  10.  
  11. ### Reset MySQL root password
  12.  
  13. Now when safe_mysqld running in one Terminal window
  14. open up another Terminal window and execute `/usr/local/mysql/bin/mysql mysql`
  15.  
  16. This opening up the MySQL console and opening the mysql table so we can update MySQL root user.
  17. Write the reset query into the console as follows
  18. ```
  19. UPDATE user SET Password=PASSWORD(‘YOUR_PASSWORD’) WHERE Host=’localhost’ AND User=’root’;
  20. ```
  21.  
  22. Replace “YOUR_PASSWORD” with your desired password.
  23.  
  24. Once you’ve done that just exit the console `exit;` close the safe_mysqld execution and restart your MySQL server.
  25.  
  26. You can do this using `sudo /Library/StartupItems/MySQLCOM/MySQLCOM start`
  27.  
  28. Once you have done that you can access mysql again with no issues
Add Comment
Please, Sign In to add comment