Mysql安装、配置(Mac)

2021-08-05  本文已影响0人  阿尔卑斯_

1、mysql官网下载 https://dev.mysql.com/downloads/mysql/(社区版x86)
2、安装的时候步骤没有Configuration,可能是mysql版本和Mac版本不匹配,找下历史版本试下
Configuration选择“传统加密”
3、配置环境变量

$vim ./.bash_profile
#添加mysql环境变量
export PATH=${PATH}:/usr/local/mysql/bin

4、进入数据库(需要输入安装时设置的密码)

$mysql -u root -p

6、进入mysql之后重置密码为root

$set password = "root";

7、查看当前数据编码格式

$mysql -u root -p
$show variables like '%char%'; 

正常会出现

+--------------------------+-----------------------------------------------------------+
| Variable_name            | Value                                                     |
+--------------------------+-----------------------------------------------------------+
| character_set_client     | utf8                                                      |
| character_set_connection | utf8                                                      |
| character_set_database   | utf8                                                      |
| character_set_filesystem | binary                                                    |
| character_set_results    | utf8                                                      |
| character_set_server     | utf8                                                      |
| character_set_system     | utf8                                                      |
| character_sets_dir       | /usr/local/mysql
上一篇下一篇

猜你喜欢

热点阅读