Change the MySQL root Password in macOS via Command Line

  • stop mysql server
ivan@ivan sudo /usr/local/mysql/support-files/mysql.server stop
  •  start mysql server with safe state
ivan@ivan sudo mysql_safe --skip-grant-tables
  •  login as root and reset password
ivan@ivan mysql -u root
mysql> flush privileges;
mysql> alter user 'root'@'localhost' identified by 'new pass word';

 

 

 

发表评论

电子邮件地址不会被公开。 必填项已用*标注

您可以使用这些HTML标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>