前提:
- 系统:mac os12
- 数据库:mysql premium
- 脚本配置参考:https://www.cnblogs.com/shineqiujuan/p/4693404.html
问题:
- 无法用brew 安装sql,所以选择手动下载(官网:https://dev.mysql.com/downloads/mysql/)
- 图形化工具链接报错:Client does not support authentication protocol requested by server; consider upgrading MySQL client
配置:(路径配置后终端可直接操作mysql)
- 服务开启关闭配置
//没有.bash_profile需要先创建
创建命令:touch .bash_profile
打开命令:open .bash_profile
编辑-添加如下信息(保存并推出):
alias mysqlstart="sudo /usr/local/mysql/support-files/mysql.server start"
alias mysqlstop="sudo /usr/local/mysql/support-files/mysql.server stop"
读取信息:source .bash_profile
测试命令:mysqlstart
- 开启后mysq操作配置
sudo touch /etc/paths.d/mysql
sudo vim /etc/paths.d/mysql
//编辑保存后,Terminal窗口重开后运行mysql
/usr/local/mysql/bin
//运行项目
mysql -h localhost -u root -p
- 可视化mysql premium操作