Stuck with Access Denied for user 'root'@'localhost' - Terminal, Mac

前端 未结 3 1894
心在旅途
心在旅途 2020-12-11 17:59

I am stuck when trying to access mysql. It\'s my first time so please be patient with me.

Initially I was try to set up Ruby and Rails and everything worked perfrec

3条回答
  •  渐次进展
    2020-12-11 19:03

    One method:

    1. stop your MySQL server.
    2. start your MySQL server with the --skip-grant-tables option. It allows you to connect to the server without a password.

      /path/to/mysqld --skip-grant-tables &
      
    3. connect to your server using the mysql client:

      mysql
      
    4. change the root password (replace NewPassord by what you want):

      UPDATE mysql.user SET password=PASSWORD('NewPassord') WHERE user='root';
      
    5. restart yout MySQL server.

    There are others ways to reset the MySQL root password: http://dev.mysql.com/doc/refman/5.6/en/resetting-permissions.html

提交回复
热议问题