在 High Sierra 上安装 Mysql 5.7

问题描述 投票:0回答:3

我想在我的 Mac OS 10.13.5 上安装 mysql 5.7。但是,brew install mysql 安装版本 8.0,它不适合我的项目。如果之前有人问过这个问题但我找不到解决方案,请原谅我。

ruby-on-rails homebrew mysql-5.7
3个回答
4
投票

现在有点不同了

brew install [email protected]

1
投票
$ brew install mysql55

这将安装与 8.0 一起存在的特定版本 5.5 另外,应将 mysql 条目添加到 .bash_profile 以确保其加载,然后应完成服务器启动。

$ brew services start [email protected]

下面的命令给出了如何按顺序加载文件的顺序。

 $ mysql --verbose --help | grep my.cnf
     order of preference, my.cnf, $MYSQL_TCP_PORT,
/etc/my.cnf /etc/mysql/my.cnf /usr/local/etc/my.cnf ~/.my.cnf 

虽然安装第一个 mysql 服务器实例工作正常,但安装不同版本的 mysql 实例时应正确配置,并且安装路径、日志文件和其他组件具有不同的路径。

安装路径可以在这里找到,例如。

mysql -> ../Cellar/mysql/8.0.11/bin/mysql

0
投票

我使用的是Apple M1。

Mysql 5.7 已停产并达到 EOL。

 brew install [email protected]
    
    ==> Downloading https://formulae.brew.sh/api/formula.jws.json
    ######################################################################### 100.0%
    ==> Downloading https://formulae.brew.sh/api/cask.jws.json
    ######################################################################### 100.0% 

Error: [email protected] has been disabled because it is not supported upstream! It was disabled on 2024-08-01.

我们需要从https://downloads.mysql.com/archives/community/

手动安装和设置

启动 MySQL

/usr/local/mysql/support-files/mysql.server start
(可能需要 sudo)

还设置 MySQL 的用户名和密码

© www.soinside.com 2019 - 2024. All rights reserved.