Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update MySQL docs #1023

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 34 additions & 3 deletions docs/debian12-install-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,39 @@ sudo apt update && sudo apt install git cmake make gcc g++ clang libssl-dev libb
### Get MySQL
```bash
mkdir -p ~/mysqlpackages && cd ~/mysqlpackages
wget https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb
sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config_0.8.32-1_all.deb
sudo apt update && sudo apt install libmysqlclient-dev mysql-server -y
```

1. Visit the [MySQL APT repository](https://dev.mysql.com/downloads/repo/apt/) page to verify and download the latest script version.
```sh
export MYSQL_APT_CONFIG_VERSION=0.8.33-1
```

1. Download the latest MySQL repository information package.

```sh
wget https://dev.mysql.com/get/mysql-apt-config_${MYSQL_APT_CONFIG_VERSION}_all.deb
```

1. (Recommended) Verify config authenticity. If you encounter any issues with this step, please refer to: https://dev.mysql.com/doc/refman/8.4/en/checking-gpg-signature.html
```sh
wget "https://dev.mysql.com/downloads/gpg/?file=mysql-apt-config_${MYSQL_APT_CONFIG_VERSION}_all.deb&p=37" -O mysql-apt-config_${MYSQL_APT_CONFIG_VERSION}_all.deb.asc
gpg --keyserver pgp.mit.edu --recv-keys A8D3785C
gpg --verify mysql-apt-config_${MYSQL_APT_CONFIG_VERSION}_all.deb.asc mysql-apt-config_${MYSQL_APT_CONFIG_VERSION}_all.deb
rm -v mysql-apt-config_${MYSQL_APT_CONFIG_VERSION}_all.deb.asc
```

1. Non-Interactive install using `DEBIAN_FRONTEND="noninteractive"` to install the latest MYSQL-LTS release, e.g. `mysql-8.4-lts` without any user prompts showing up.

```sh
sudo DEBIAN_FRONTEND="noninteractive" dpkg -i ./mysql-apt-config_${MYSQL_APT_CONFIG_VERSION}_all.deb
rm -v ./mysql-apt-config_${MYSQL_APT_CONFIG_VERSION}_all.deb
unset MYSQL_APT_CONFIG_VERSION
sudo apt-get update
sudo DEBIAN_FRONTEND="noninteractive" apt-get install -y mysql-server libmysqlclient-dev
```

1. Harden installation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove this step. Noninteractive install of mysql sets root to socket authentication (no password) which leads to an error at the root password part of mysql_secure_installation.

```bash
sudo mysql_secure_installation
```
- Validate password component: N
Expand All @@ -80,6 +110,7 @@ sudo mysql_secure_installation
- Disallow root login remotely: Y
- Remove test database: Y
- Reload privilege tables: Y

### Setup SQL Database
```bash
sudo mysql -u root -p
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to just sudo mysql and remove instruction to enter password. (same here)

Expand Down
28 changes: 24 additions & 4 deletions docs/linux-requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,33 @@ Remember that if you are using the `root` user, it is not necessary to use `sudo

---

#### Install MYSQL
##### Install MySQL

Non-Interactive install using `DEBIAN_FRONTEND="noninteractive"` to install the latest MYSQL-LTS release, e.g. `mysql-8.4-lts` without any user prompts showing up.
1. Visit the [MySQL APT repository](https://dev.mysql.com/downloads/repo/apt/) page to verify and download the latest script version.
```sh
export MYSQL_APT_CONFIG_VERSION=0.8.33-1
```

1. Download the latest MySQL repository information package.

```sh
wget https://dev.mysql.com/get/mysql-apt-config_${MYSQL_APT_CONFIG_VERSION}_all.deb
```

1. (Recommended) Verify config authenticity. If you encounter any issues with this step, please refer to: https://dev.mysql.com/doc/refman/8.4/en/checking-gpg-signature.html
```sh
wget "https://dev.mysql.com/downloads/gpg/?file=mysql-apt-config_${MYSQL_APT_CONFIG_VERSION}_all.deb&p=37" -O mysql-apt-config_${MYSQL_APT_CONFIG_VERSION}_all.deb.asc
gpg --keyserver pgp.mit.edu --recv-keys A8D3785C
gpg --verify mysql-apt-config_${MYSQL_APT_CONFIG_VERSION}_all.deb.asc mysql-apt-config_${MYSQL_APT_CONFIG_VERSION}_all.deb
rm -v mysql-apt-config_${MYSQL_APT_CONFIG_VERSION}_all.deb.asc
```

1. Non-Interactive install using `DEBIAN_FRONTEND="noninteractive"` to install the latest MYSQL-LTS release, e.g. `mysql-8.4-lts` without any user prompts showing up.

```sh
wget https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb
sudo DEBIAN_FRONTEND="noninteractive" dpkg -i ./mysql-apt-config_0.8.32-1_all.deb
sudo DEBIAN_FRONTEND="noninteractive" dpkg -i ./mysql-apt-config_${MYSQL_APT_CONFIG_VERSION}_all.deb
rm -v ./mysql-apt-config_${MYSQL_APT_CONFIG_VERSION}_all.deb
unset MYSQL_APT_CONFIG_VERSION
sudo apt-get update
sudo DEBIAN_FRONTEND="noninteractive" apt-get install -y mysql-server libmysqlclient-dev
```
Expand Down