8

mac mysql8配置管理

 3 years ago
source link: https://www.ffeeii.com/2529.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

mac mysql8配置管理

Mysql 使用dmg按照包安装后好后,需要做一些基本配置,方便维护Mysql。

将Mysql命令加入终端

 sudo vi ~/.zprofile

在文件最后输入,我用的是Iterm,所以是.zprofile,其他的终端名称是.bash_profile

PATH=$PATH:/usr/local/mysql/bin
export PATH

系统偏好配置界面,MySql

image-6.png

启动、关闭mysql都可以可视化操作。

mysql8因为默认没有配置文件,添加一个配置文件my.cnf,文件位置随意,这里放在/usr/local/mysql/下

sudo vi /usr/local/mysql/my.cnf
[client]
default-character-set=utf8

[mysqld]
character-set-server=utf8

sql_mode='NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'

[mysql]  
default-character-set=utf8
resize,m_fill,h_832,w_1024

Configuration File前面勾上,然后在后面输入创建的my.cnf,点最右下角Apply,

然后Stop Mysql Server,接着Start Mysql Server,如果能启动成功,就代表配置文件起效了。

在和程序连接测试过程中发现,由于密码强度问题,客户端连接不上,如果碰到此问题,安装Mysql 8的时候记得选取Use Legacy Password Encryptiong。

Be First to Comment

发表评论 取消回复

电子邮件地址不会被公开。 必填项已用*标注

Comment

Name*

Email*

Website

在此浏览器中保存我的名字、电邮和网站。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK