# MySQL mirror (pkg.shecan.ir)

> Mirror of repo.mysql.com (apt for Debian/Ubuntu, yum for EL and Fedora: MySQL Community Server 8.0/8.4 LTS/9.x, MySQL Shell, Router, connectors) and its signing keys. repo.mysql.com redirects Iranian addresses to its embargo page.

- Upstream: repo.mysql.com
- Mirror URL: <https://mirror-mysql.pkg.shecan.ir/>
- Clients: apt, dnf, yum
- Service status: <https://pkg.shecan.ir/status.json> (key `mysql`; up/down, refreshed every minute)
- Guide (Persian, HTML): <https://pkg.shecan.ir/mirrors/mysql/>
- JSON: <https://pkg.shecan.ir/api/v1/mirrors/mysql.json>

## Limitations

- apt and dnf still verify the MySQL signature. Use RPM-GPG-KEY-mysql-2025: the 2023 file holds the same key with an expiry date that has passed.
- The apt repository has amd64 packages only (no arm64).
- The release packages mysql-apt-config and mysql*-community-release are not served (they point the system at repo.mysql.com); configure the repository with the commands of this guide.

## Setup

Every block below is the exact text of the Persian guide. Unless marked otherwise it is run against the live mirror in a disposable container on every catalog change; "checked by hand" blocks cannot run in a container. Change a machine only with its owner's permission: back up existing configuration first, merge into existing files instead of overwriting them, and keep the "Undo" step at hand.

### apt: persistent (user- or system-wide configuration)

Run, Ubuntu or Debian (linux)

```sh
sudo install -d /etc/apt/keyrings
sudo curl -fsSLo /etc/apt/keyrings/mysql.asc https://mirror-mysql.pkg.shecan.ir/RPM-GPG-KEY-mysql-2025
. /etc/os-release
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/mysql.asc] https://mirror-mysql.pkg.shecan.ir/apt/$ID $VERSION_CODENAME mysql-8.4-lts mysql-tools" | sudo tee /etc/apt/sources.list.d/mysql.list
sudo apt update && sudo apt install -y mysql-server
```

Undo / restore the default, Ubuntu or Debian (linux)

```sh
sudo rm -f /etc/apt/sources.list.d/mysql.list /etc/apt/keyrings/mysql.asc
sudo apt update
```

### dnf, yum: persistent (user- or system-wide configuration)

Configuration file (linux): `/etc/yum.repos.d/mysql-community.repo`

```ini
[mysql-8.4-lts-community]
name=MySQL 8.4 LTS Community Server
baseurl=https://mirror-mysql.pkg.shecan.ir/yum/mysql-8.4-community/el/$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=https://mirror-mysql.pkg.shecan.ir/RPM-GPG-KEY-mysql-2025

[mysql-tools-8.4-lts-community]
name=MySQL Tools 8.4 LTS Community
baseurl=https://mirror-mysql.pkg.shecan.ir/yum/mysql-tools-8.4-community/el/$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=https://mirror-mysql.pkg.shecan.ir/RPM-GPG-KEY-mysql-2025
```

Undo / restore the default (linux)

```sh
sudo rm -f /etc/yum.repos.d/mysql-community.repo
sudo dnf clean all
```

### dnf: persistent (user- or system-wide configuration)

Run (linux) (checked by hand)

```sh
sudo dnf install -y mysql-community-server
```
