Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mac brew 安装mysql #10

Open
zhengzhuang96 opened this issue Mar 23, 2020 · 0 comments
Open

mac brew 安装mysql #10

zhengzhuang96 opened this issue Mar 23, 2020 · 0 comments

Comments

@zhengzhuang96
Copy link
Owner

zhengzhuang96 commented Mar 23, 2020

打开控制台

$ brew install mysql

image

  1. 我们现在已经配置成功了,需要设置根密码,它让我们输入mysql_secure_installation
$ mysql_secure_installation

image

结果输入密码后报错:Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

解决方法:先执行mysql.server start重启一下,然后mysql_secure_installation,在输入密码基本上就成功了

然后会有很多问题,来让你回复,

Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
同意呢就回复y,不同意就回复其他的,比如a呀b呀c呀
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.
默认情况下,MySQL安装有一个匿名用户,
允许任何人登录MySQL而不必
为他们创建的用户帐户。这只是为了
测试,使安装更顺利。
你应该在投入生产前把它们去掉环境。

这样的就是看你自己的意愿了

Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.
通常,根目录只允许从
“本地主机”。这保证了有人不能猜到
来自网络的根密码。
Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.
重新加载特权表将确保所有更改
到目前为止所做的将立即生效。
  1. 然后前往下载,mac navicat免激活版
    第一步:控制台执行
    sudo spctl --master-disable
    第二步:下载安装即可使用,里面还有一个汉化包
链接:https://pan.baidu.com/s/1LJAXn13KBcb4Xq8xfVXlhw  密码:ra1k

第三步:汉化
复制中文包”zh-Hans.lproj”放到 /Contents/Resources 即可。(应用程序右键显示包内容)
image
image
image
到这里就安装完成了,
image
完了点好。如果出现连接错误:
打开终端,通过终端连接mysql数据库时候我们会看到这样的信息:

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

不要慌,正常,解决上面错误的方法之一就是重新设置我们的mysql的root密码
第一,右击选择这条数据库,选择编辑连接
第二,在常规里面重新编辑密码即可

到这一步就大功告成
image

@zhengzhuang96 zhengzhuang96 changed the title 123123 mac brew 安装mysql Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant