我正在尝试在 Mac OS 10.8 上安装 mySQL 并设置用户帐户。注意在终端窗口中使用命令行时,我是一个绝对初学者。
我使用这些说明进行安装: http: //www.macminivault.com/mysql-mountain-lion/
我在这里为所有用户设置了自己的密码:
GRANT ALL ON *.* TO 'root'@'localhost' IDENTIFIED BY 'mypass' WITH GRANT OPTION;
quit
每次我尝试在命令行上以 root 用户身份执行 mySQL 时,都会得到以下信息:
Ciarans-MacBook-Pro:~ callanmooneys$ mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
我在网上阅读并尝试了各种方法,包括尝试更改密码:
mysqladmin -u root -pyourcurrentmysqlrootpassword password yournewmysqlrootpassword,
it returns ->
-> USE mysql
->
如果我只是输入“mysql”并启动 mySQL 监视器,然后尝试创建一个用户帐户:
mysql> USE mysql
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'
mysql>
还尝试了论坛上的答案:访问被拒绝用户'root'@localhost mysql错误1045返回'root@127.0.0.1 command not found
Ciarans-MacBook-Pro:~ callanmooneys$ mysqld_safe --skip-grant-tables
131105 21:44:41 mysqld_safe Logging to '/usr/local/mysql/data/Ciarans-MacBook-Pro.local.err'.
131105 21:44:41 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
/usr/local/mysql/bin/mysqld_safe: line 129: /usr/local/mysql/data/Ciarans-MacBook-Pro.local.err: Permission denied
/usr/local/mysql/bin/mysqld_safe: line 166: /usr/local/mysql/data/Ciarans-MacBook-Pro.local.err: Permission denied
131105 21:44:41 mysqld_safe mysqld from pid file /usr/local/mysql/data/Ciarans-MacBook-Pro.local.pid ended
/usr/local/mysql/bin/mysqld_safe: line 129: /usr/local/mysql/data/Ciarans-MacBook-Pro.local.err: Permission denied
Ciarans-MacBook-Pro:~ callanmooneys$ mysql -u root
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
Ciarans-MacBook-Pro:~ callanmooneys$
反馈表示赞赏。