mac mysql Access denied for user问题解决方法

摘自 stackoverflow回答

Here is the procedure to reset password of root user.

1) Stop mysql (Kill mysql process or run following command)

sudo /usr/local/mysql/support-files/mysql.server stop

2) Start it in safe mode

sudo mysqld_safe --skip-grant-tables

3) Open another terminal and run the following command (Keep last terminal open)

mysql -u root

4) Run the following command with suitable new password on the mysql console

mysql > UPDATE mysql.user SET Password=PASSWORD(‘password‘) WHERE User=‘root‘;

5) mysql > FLUSH PRIVILEGES;

6) Quit from both terminals and open new terminal and connect to mysql with root user and new password

mysql -uroot -p
时间: 2024-12-05 10:01:57

mac mysql Access denied for user问题解决方法的相关文章

phpmyadmin mysql Access denied for user 'root'@'localhost'问题解决

centos6.4 32位的vps上装了lnmp以后,phpmyadmin无法连接mysql服务器,ssh命令行里mysql -uroot -p 命令后老是出现拒绝连接的情况.php程序里也是拒绝连接.尝试过修改phpmyadmin的config.inc.php文件,尝试过修改my.cnf文件,尝试过修改php.ini文件,都不行.连 lnmp.org官方都找不到解决办法. 网上找了很多地方,脑袋都炸了..终于找到解决办法.. 解决办法地址:http://bbs.vpser.net/thread

mysql Access denied for user [email protected]错误解决方法总结(转)

mysql Access denied for user [email protected]错误解决方法总结(转) mysql Access denied for user \'root\'@\'localhost\'”解决办法总结,下面我们对常见的出现的一些错误代码进行分析并给出解决办法,有需要的朋友可参考一下. 错误代码 1045 Access denied for user 'root'@'localhost' (using password:YES) 解决办法是重新设置root用户密码,

MySQL Access denied for user [email protected] 解决方法

今天把本地开发的项目(ThinkPHP 3.2.3)移到虚拟机上(CentOS 6.6,LNMP 1.2,MySQL 5.6.23),配置好 MySQL 之后访问首页,出现: 此时 MySQL 的用户名和密码都是 root 解决方法是: # /etc/init.d/mysql stop # mysqld_safe --user=mysql --skip-grant-tables --skip-networking & # mysql -u root mysql mysql> UPDATE u

解决mysql“Access denied for user 'root'@'localhost'”

解决mysql“Access denied for user 'root'@'localhost'” 分类: linux 2011-01-14 00:23 147547人阅读 评论(3) 收藏 举报 mysqluseraccessmanager数据库system # mysql -uroot -pEnter password:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) 使用网

解决mysql"Access denied for user'root'@'IP地址'"问题

在按照前面文章中方法搭建Mysql数据库之后,发现其他机器还是不能访问, 参考以下文章对权限进行修改之后,发现本地机器中root不能访问了. http://www.cnblogs.com/ycsfwhh/archive/2012/08/07/2626597.html 后来使用 select host, user, grant_priv from user; 发现grant_priv一列有问题,只有有grant_priv的用户才能对其他用户赋予权限. 修改成以下这样,就好了. +---------

mysql Access denied for user 'root'@'localhost' (using password: YES)

[现象说明] C/S程序远程訪问正常,本地訪问报下面异常 MySql.Data.MySqlClient.MySqlException (0x80004005): Authentication to host 'localhost' for user 'root' using method 'mysql_native_password' failed with message: Access denied for user 'root'@'localhost' (using password: Y

Mysql Access denied for user 'root'

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) 解决方法 原密码为空,更改root密码 1 # service mysql stop 2 # mysqld_safe --user=mysql --skip-grant-tables --skip-networking 3 4 # mysql -u root mysql 5 mysql> update user set passwo

linux mysql access denied for user ‘root’@’localhost'(using password:YES)

linux安装完mysql后,使用程序连接报以上错误 解决方法,重新设置密码,步骤如下 1.先停掉原来的服务 service mysqld stop 2.使用安全模式登陆,跳过密码验证 mysqld_safe --user=mysql --skip-grant-tables --skip-networking& 3.登陆 mysql -uroot mysql 4.修改密码 mysql > update user set authentication_string = password('12

mysql Access denied for user 'root'@'localhost' (using password: YES)

[现象说明] C/S程序远程访问正常,本地访问报以下异常 MySql.Data.MySqlClient.MySqlException (0x80004005): Authentication to host 'localhost' for user 'root' using method 'mysql_native_password' failed with message: Access denied for user 'root'@'localhost' (using password: Y