安装后进行mysql登录[错误1045(28000):用户'mike'@'localhost'的访问被拒绝(使用密码:是) [英] mysql login after install [ERROR 1045 (28000): Access denied for user 'mike'@'localhost' (using password: YES)]

查看:349
本文介绍了安装后进行mysql登录[错误1045(28000):用户'mike'@'localhost'的访问被拒绝(使用密码:是)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用装有山狮的Mac,我刚刚安装了mysql.我现在正尝试使用以下命令登录

Using a mac w/ mountain lion, I just installed mysql. I am now trying to login using the following command

mysql -u mike -p

但出现以下错误:

ERROR 1045 (28000): Access denied for user 'mike'@'localhost' (using password: YES)

我已经参考了以下SO问题&答案: MySQL错误1045(28000):访问权限用户'bill'@'localhost'被拒绝(使用密码:是)

I have referenced the following SO question & answer: MySQL ERROR 1045 (28000): Access denied for user 'bill'@'localhost' (using password: YES)

基于所有这些答案,我需要在mysql命令行中创建一个新的本地用户,但是如果无法访问mysql>(命令行),该怎么办?

based on all those answers I need to create a new local user inside mysql command line, but how do I do this if I can't get access to the mysql> (command line)?

推荐答案

默认情况下,root用户在MySQL中没有密码(除非您在安装过程中在mysql中设置了root密码).尝试这样登录:

By default, the root user has no password in MySQL (unless you set a root password in mysql during the install). Try logging in like this:

mysql -u root

请注意排除-p参数.

这篇关于安装后进行mysql登录[错误1045(28000):用户'mike'@'localhost'的访问被拒绝(使用密码:是)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆