mysql - `brew link mysql` 给出 "Error: Could not symlink bin/my_print_defaults"

标签 mysql mysql-connector-c

brew install mysql-connector-c

给予:

Error: Cannot install mysql-connector-c because conflicting formulae are installed.

  mysql: because both install MySQL client libraries

Please `brew unlink mysql` before continuing.

所以:

brew unlink mysql
Unlinking /usr/local/Cellar/mysql/5.7.9... 88 symlinks removed

brew install mysql-connector-c

工作正常。但是现在 brew link mysql 给出:

Linking /usr/local/Cellar/mysql/5.7.9... 
Error: Could not symlink bin/my_print_defaults
Target /usr/local/bin/my_print_defaults
is a symlink belonging to mysql-connector-c. You can unlink it:
  brew unlink mysql-connector-c

To force the link and overwrite all conflicting files:
  brew link --overwrite mysql

To list all files that would be deleted:
  brew link --overwrite --dry-run mysql

困惑。取消链接?覆盖?

最佳答案

我遇到了同样的情况。 我按如下方式解决了这个问题。

$ ls /usr/local/Cellar/mysql*
/usr/local/Cellar/mysql:
5.7.19

/usr/local/Cellar/mysql-connector-c:
6.1.11

$ brew unlink mysql
Unlinking /usr/local/Cellar/mysql/5.7.19... 0 symlinks removed

$ brew link --force mysql-connector-c
Warning: Already linked: /usr/local/Cellar/mysql-connector-c/6.1.11
To relink: brew unlink mysql-connector-c && brew link mysql-connector-c

$ brew unlink mysql-connector-c
Unlinking /usr/local/Cellar/mysql-connector-c/6.1.11... 48 symlinks removed

$ brew link mysql-connector-c
Linking /usr/local/Cellar/mysql-connector-c/6.1.11... 48 symlinks created

$ mysql
zsh: command not found: mysql

$ brew unlink mysql-connector-c
Unlinking /usr/local/Cellar/mysql-connector-c/6.1.11... 48 symlinks removed

$ brew link mysql
Linking /usr/local/Cellar/mysql/5.7.19... 93 symlinks created

$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor…..

关于mysql - `brew link mysql` 给出 "Error: Could not symlink bin/my_print_defaults",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44051686/

相关文章:

c++ - mysql-connector-c++ 8.0 连接被拒绝

C - 从 char[] 创建 const char*

c++ - MySQL C++ 不读取结果

php - 将mysql数据库中的字符串转换为数组

mysql - 将值插入链接服务器 (ODBC)

php - 在一行中加入多个相同列的查询

Mysql使用一个特定的主键自动增加一列

c++ - 静态库 (/MT) 链接与项目/MTd 选项冲突

mysql - 具有未知文件夹结构和数据库文件的 CakePHP 2.x 项目,使用 EnvSwitcher 类