# 使用 Homebrew, apk, chocolatey, dnf, apt, pacman, scoop, winget, zypper 安装 mysql

查看 mysql 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:mysql
```

## 代理安全回答

mysql provides client and server tooling that can read or mutate databases.

- **凭据访问:** Reads database passwords, option files, client config, and environment credentials.
- **远程变更:** Can create, drop, alter, and export databases on reachable servers.
- **发布/制品风险:** Can dump or import data artifacts that may contain sensitive records.
- **推荐控制:** Gate destructive SQL, dumps, imports, and credential file access.
- **代理使用指南:** Allow schema inspection on safe targets; require approval for writes, dumps, and credential reads.

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install mysql
```

  证据: local Homebrew formula metadata

### Linux

- apk (92%):

```sh
sudo apk add mysql
```

  证据: Alpine Linux edge package indexes: mysql from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz

- dnf (92%):

```sh
sudo dnf install mysql
```

  证据: Fedora Rawhide package metadata: mysql from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst

- Debian apt (92%):

```sh
sudo apt install libmysql++-dev
```

  证据: Debian stable package indexes: libmysql++-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- pacman (92%):

```sh
sudo pacman -S mariadb
```

  证据: Arch Linux sync databases: mariadb from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- zypper (92%):

```sh
sudo zypper install mariadb
```

  证据: openSUSE Tumbleweed package metadata: mariadb from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

### Windows

- Chocolatey (92%):

```sh
choco install mysql
```

  证据: Chocolatey community package catalog: mysql from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='11','multipass'

- Scoop (92%):

```sh
scoop install main/mysql
```

  证据: Scoop official bucket manifest trees: bucket/mysql.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

- winget (92%):

```sh
winget install --id Oracle.MySQL -e
```

  证据: Windows Package Manager source index: Oracle.MySQL from https://cdn.winget.microsoft.com/cache/source.msix

## 软件包事实

- **软件包键:** brew:mysql
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/mysql>
- **版本:** 9.7.1
- **来源摘要:** Open source relational database management system
- **主页:** <https://github.com/mysql/mysql-server>
- **仓库:** <https://github.com/mysql/mysql-server>
- **许可证:** GPL-2.0-only WITH Universal-FOSS-exception-1.0
- **源码归档:** <https://cdn.mysql.com/Downloads/MySQL-9.7/mysql-9.7.1.tar.gz>
- **最后更新:** 2026-08-04T13:11:24+01:00
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- comp_err (cli)
- ibd2sdi (cli)
- innochecksum (cli)
- my_print_defaults (cli)
- myisam_ftdump (cli)
- myisamchk (cli)
- myisamlog (cli)
- myisampack (cli)
- mysql (cli)
- mysql.server (cli)
- mysql_client_test (cli)
- mysql_config (cli)
- mysql_config_editor (cli)
- mysql_keyring_encryption_test (cli)
- mysql_migrate_keyring (cli)
- mysql_secure_installation (cli)
- mysql_test_event_tracking (cli)
- mysql_tzinfo_to_sql (cli)
- mysqladmin (cli)
- mysqlbinlog (cli)
- mysqlcheck (cli)
- mysqld (cli)
- mysqld_multi (cli)
- mysqld_safe (cli)
- mysqldump (cli)
- mysqldumpslow (cli)
- mysqlimport (cli)
- mysqlrouter (cli)
- mysqlrouter_bootstrap (cli)
- mysqlrouter_keyring (cli)
- mysqlrouter_mrs_client (cli)
- mysqlrouter_passwd (cli)
- mysqlrouter_plugin_info (cli)
- mysqlshow (cli)
- mysqlslap (cli)
- mysqltest (cli)
- mysqltest_safe_process (cli)
- mysqlxtest (cli)
- perror (cli)
- comp_err (别名)
- ibd2sdi (别名)
- innochecksum (别名)
- my_print_defaults (别名)
- myisam_ftdump (别名)
- myisamchk (别名)
- myisamlog (别名)
- myisampack (别名)
- mysql (别名)
- mysql.server (别名)
- mysql_client_test (别名)
- mysql_config (别名)
- mysql_config_editor (别名)
- mysql_keyring_encryption_test (别名)
- mysql_migrate_keyring (别名)
- mysql_secure_installation (别名)
- mysql_test_event_tracking (别名)
- mysql_tzinfo_to_sql (别名)
- mysqladmin (别名)
- mysqlbinlog (别名)
- mysqlcheck (别名)
- mysqld (别名)
- mysqld_multi (别名)
- mysqld_safe (别名)
- mysqldump (别名)
- mysqldumpslow (别名)
- mysqlimport (别名)
- mysqlrouter (别名)
- mysqlrouter_bootstrap (别名)
- mysqlrouter_keyring (别名)
- mysqlrouter_mrs_client (别名)
- mysqlrouter_passwd (别名)
- mysqlrouter_plugin_info (别名)
- mysqlshow (别名)
- mysqlslap (别名)
- mysqltest (别名)
- mysqltest_safe_process (别名)
- mysqlxtest (别名)
- perror (别名)

## 依赖

- abseil
- icu4c@78
- lz4
- openssl@3
- protobuf
- zlib-ng-compat
- zstd

## 构建依赖

- bison
- cmake
- pkgconf

## macOS 提供的库

- curl
- cyrus-sasl
- libedit

## 安装行为

- post-install 钩子: 未定义
- 服务: declared
- 注意事项: A "/etc/my.cnf" or "/etc/mysql/my.cnf" from another install may interfere with a Homebrew-built server starting up correctly. Upgrading from MySQL <8.4 to MySQL >9.0 requires running MySQL 8.4 first: - brew services stop mysql - brew install mysql@8.4 - brew services start mysql@8.4 - brew services stop mysql@8.4 - brew services start mysql We've installed your MySQL database without a root password. To secure it run: mysql_secure_installation MySQL is configured to only allow connections from localhost by default To connect run: mysql -u root
- Bottle: 可用 于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 9.7.1
- 管理器更新时间: 2026-08-04
- 本地数据: OK
- 上游仓库: https://github.com/mysql/mysql-server
- 信息: No cached GitHub release or tag data was available.
## 项目历史与用法

MySQL is an open-source relational database management system that grew out of work by Michael "Monty" Widenius, David Axmark, and Allan Larsson. Oracle's manual says the team first intended to use mSQL with its own ISAM routines, then built a new SQL interface after finding mSQL too slow or inflexible; the name comes from Widenius's daughter, My. MySQL AB was founded in Sweden in 1995, the project adopted GPL distribution in 2000, and Sun Microsystems acquired MySQL AB in 2008 before Oracle acquired Sun.

### 项目历史

The system became one of the defining databases of the LAMP stack: MySQL Server provides a multithreaded SQL server, client programs and libraries, administrative tools, and APIs, and it can be used as a client/server database or embedded library. Its ecosystem role was shaped by web deployment, dual licensing, and storage-engine evolution, including InnoDB's rise as the transactional backend. Oracle's customer pages list users across media, ecommerce, financial services, technology, telecom, education, and manufacturing, with named examples such as YouTube, GitHub, Uber, Square, BBC, Spotify, Airbus/EADS, Boeing, and the University of Toronto.

### 使用方式

In package-manager terms, Homebrew's unversioned `mysql` formula follows the active upstream server line and installs the server plus common client and administrative programs such as `mysql`, `mysqld`, `mysqldump`, `mysqladmin`, and `mysql_secure_installation`. Homebrew also keeps versioned formulae such as `mysql@8.4` and `mysql@8.0`, and the main formula notes conflicts with MariaDB and Percona Server, reflecting MySQL's long-standing relationship with compatible forks and alternative server distributions.

### 来源

- <https://dev.mysql.com/doc/refman/8.4/en/history.html>
- <https://dev.mysql.com/doc/refman/8.4/en/what-is-mysql.html>
- <https://formulae.brew.sh/formula/mysql>
- <https://planet.mysql.com/entry/?id=23788>
- <https://www.mysql.com/customers/>


## 安全说明

broad file, network, media, or database tool signal. formula declares a Homebrew service.

- **Geiger 风险:** orange / 中
- broad file, network, media, or database tool signal
- formula declares a Homebrew service


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: ~/.my.cnf

## Credential files

- Unix: ~/.my.cnf
## 源数据库详情

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** mysql
- **Aliases:** mysql@9.7
- **Version Scheme:** 0
- **Revision:** 0
- **Conflicts With:** mariadb, percona-server
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** stable

## 其他软件包管理器记录

- Debian apt - libmysql++-dev - 3.2.5-2.3+b1: normalized package name match | Debian stable package indexes: libmysql++-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | MySQL C++ library bindings (development) | https://tangentsoft.net/mysqlpp/
- Debian apt - libmysql++-doc - 3.2.5-2.3: normalized package name match | Debian stable package indexes: libmysql++-doc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | MySQL C++ library bindings (documentation and examples) | https://tangentsoft.net/mysqlpp/
- Debian apt - libmysql++3t64 - 3.2.5-2.3+b1: normalized package name match | Debian stable package indexes: libmysql++3t64 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | MySQL C++ library bindings (runtime) | https://tangentsoft.net/mysqlpp/
- Ubuntu apt - libmysql++-dev - 3.2.5-2.3: normalized package name match | Ubuntu 24.04 LTS package indexes: libmysql++-dev from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | MySQL C++ library bindings (development) | https://tangentsoft.net/mysqlpp/
- Ubuntu apt - libmysql++-doc - 3.2.5-2.3: normalized package name match | Ubuntu 24.04 LTS package indexes: libmysql++-doc from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | MySQL C++ library bindings (documentation and examples) | https://tangentsoft.net/mysqlpp/
- Ubuntu apt - libmysql++3t64 - 3.2.5-2.3: normalized package name match | Ubuntu 24.04 LTS package indexes: libmysql++3t64 from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | MySQL C++ library bindings (runtime) | https://tangentsoft.net/mysqlpp/
- apk - mysql - 11.8.8-r0: normalized package name match | Alpine Linux edge package indexes: mysql from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Dummy package for mysql migration | https://www.mariadb.org/
- dnf - mysql - 9.7.2-1.fc45: normalized package name match | Fedora Rawhide package metadata: mysql from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst | MySQL client programs and shared libraries | http://www.mysql.com
- dnf - mysql++ - 3.3.0-13.fc45: normalized package name match | Fedora Rawhide package metadata: mysql++ from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst | C++ wrapper for the MySQL C API | https://tangentsoft.com/mysqlpp/home
- dnf - mysql++-devel - 3.3.0-13.fc45: normalized package name match | Fedora Rawhide package metadata: mysql++-devel from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst | MySQL++ developer files (headers, examples, etc.) | https://tangentsoft.com/mysqlpp/home
- dnf - mysql++-manuals - 3.3.0-13.fc45: normalized package name match | Fedora Rawhide package metadata: mysql++-manuals from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst | MySQL++ user and reference manuals | https://tangentsoft.com/mysqlpp/home
- pacman - mariadb - 12.3.2-4: normalized package name match | Arch Linux sync databases: mariadb from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Fast SQL database server, derived from MySQL | https://mariadb.org/
- pacman - mariadb-lts - 11.8.8-3: normalized package name match | Arch Linux sync databases: mariadb-lts from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Fast SQL database server, derived from MySQL (LTS) | https://mariadb.org/
- pacman - mysql++ - 3.3.0-2: normalized package name match | Arch Linux sync databases: mysql++ from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | A C++ wrapper for MySQLs C API | http://tangentsoft.net/mysql++/
- zypper - mariadb - 12.3.2-1.3: normalized package name match | openSUSE Tumbleweed package metadata: mariadb from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Server part of MariaDB | https://www.mariadb.org
- Chocolatey - mysql: normalized package name match | Chocolatey community package catalog: mysql from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='11','multipass'


## 相关链接

- [Source-control packages](https://pkg.so/zh-hans/source-control-tools/) - Belongs to a source-control command family.
- [Secret-risk packages](https://pkg.so/zh-hans/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [Terminal utility packages](https://pkg.so/zh-hans/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://pkg.so/zh-hans/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [openssl@3](https://pkg.so/zh-hans/brew/openssl-3/) - Runtime dependency declared by Homebrew.
- [zstd](https://pkg.so/zh-hans/brew/zstd/) - Runtime dependency declared by Homebrew.
- [lz4](https://pkg.so/zh-hans/brew/lz4/) - Runtime dependency declared by Homebrew.
- [protobuf](https://pkg.so/zh-hans/brew/protobuf/) - Runtime dependency declared by Homebrew.
- [pkgconf](https://pkg.so/zh-hans/brew/pkgconf/) - Build dependency declared by Homebrew.
- [cmake](https://pkg.so/zh-hans/brew/cmake/) - Build dependency declared by Homebrew.
- [bison](https://pkg.so/zh-hans/brew/bison/) - Build dependency declared by Homebrew.
- [mysql@8.0](https://pkg.so/zh-hans/brew/mysql-8-0/) - Package name indicates the same formula family.
- [mysql@8.4](https://pkg.so/zh-hans/brew/mysql-8-4/) - Package name indicates the same formula family.
- [postgresql@14](https://pkg.so/zh-hans/brew/postgresql-14/) - Shares pkgdb curated category or tags: cli, data, database, rdbms, server.
- [postgresql@16](https://pkg.so/zh-hans/brew/postgresql-16/) - Shares pkgdb curated category or tags: cli, data, database, rdbms, server.
- [postgresql@17](https://pkg.so/zh-hans/brew/postgresql-17/) - Shares pkgdb curated category or tags: cli, data, database, rdbms, server.
- [postgresql@18](https://pkg.so/zh-hans/brew/postgresql-18/) - Shares pkgdb curated category or tags: cli, data, database, rdbms, server.
- [postgresql@15](https://pkg.so/zh-hans/brew/postgresql-15/) - Shares pkgdb curated category or tags: cli, data, database, rdbms, server.
- [percona-server](https://pkg.so/zh-hans/brew/percona-server/) - Shares pkgdb curated category or tags: cli, data, database, mysql, server.
- [mariadb](https://pkg.so/zh-hans/brew/mariadb/) - Shares pkgdb curated category or tags: cli, data, database, server, sql.
- [lazysql](https://pkg.so/zh-hans/brew/lazysql/) - Shares pkgdb curated category or tags: cli, data, database, mysql, sql.

## Combined YAML source

View the package source record on GitHub. [combined/mysql.yml](https://github.com/mxcl/pkgdb/blob/main/combined/mysql.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- package-page enrichment
- curated configuration and credential file locations
- curated package history
- package version freshness
- pkgdb category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
- curated agent safety answer
