MySQL: Change root password in Mac

来源:互联网 发布:淘宝服装店铺策划书 编辑:程序博客网 时间:2024/06/04 19:21

Step 1.

$ sudo /usr/local/mysql/bin/mysqld_safe –user=root & //start MySQL(Also, can start MySQL in System Preferences)

Step 2.

$ sudo /usr/local/mysql/bin/mysqladmin -uroot password yourpassword //set MySQL password to yourpassword(Attention: this command used when there is no password the first time)

OR

Step 2.

$ sudo /usr/local/mysql/bin/mysqladmin -uroot -pyourCurrentpassword password yourNewpassword //change MySQL password to yourNewpassword(Attention: this command used to change the current password)
0 0
原创粉丝点击