Skip to content

Instantly share code, notes, and snippets.

@redleafar
Created January 29, 2019 18:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save redleafar/6493c9a61fa84f4a0dd22214dcb8e7de to your computer and use it in GitHub Desktop.
Save redleafar/6493c9a61fa84f4a0dd22214dcb8e7de to your computer and use it in GitHub Desktop.
Problems with MySql in Mac

https://stackoverflow.com/questions/6474775/setting-the-mysql-root-user-password-on-os-x

Stop the mysqld server. Mac OSX: System Preferences > MySQL > Stop MySQL Server Linux (From Terminal): sudo systemctl stop mysqld.service

Start the server in safe mode with privilege bypass From Terminal: sudo /usr/local/mysql/bin/mysqld_safe --skip-grant-tables

In a new terminal window: sudo /usr/local/mysql/bin/mysql -u root

This will open the mysql command line. From here enter:

UPDATE mysql.user SET authentication_string=PASSWORD('NewPassword') WHERE User='root'; FLUSH PRIVILEGES; quit

Stop the mysqld server again and restart it in normal mode.

Mac OSX (From Terminal): sudo /usr/local/mysql/support-files/mysql.server restart Linux Terminal: sudo systemctl restart mysqld

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment