Last active
November 8, 2024 15:04
-
-
Save runekaagaard/0ef1cab7f916cd3ae294bb8343f652b3 to your computer and use it in GitHub Desktop.
Unattended install of mysql 5.7.42 (latest ubuntu deb packages) on Ubuntu 22.04. Change ROOT_PASSWORD. Choose gdal support.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
# Pre-configure root password | |
export DEBIAN_FRONTEND=noninteractive | |
ROOT_PASSWORD="your_password_here" | |
debconf-set-selections <<< "mysql-community-server mysql-community-server/root-pass password $ROOT_PASSWORD" | |
debconf-set-selections <<< "mysql-community-server mysql-community-server/re-root-pass password $ROOT_PASSWORD" | |
mkdir -p /tmp/mysql-install | |
cd /tmp/mysql-install | |
wget https://downloads.mysql.com/archives/get/p/23/file/mysql-server_5.7.42-1ubuntu18.04_amd64.deb-bundle.tar | |
tar xf mysql-server_5.7.42-1ubuntu18.04_amd64.deb-bundle.tar | |
apt install -y \ | |
./mysql-common_5.7.42-1ubuntu18.04_amd64.deb \ | |
./libmysqlclient20_5.7.42-1ubuntu18.04_amd64.deb \ | |
./mysql-community-client_5.7.42-1ubuntu18.04_amd64.deb \ | |
./mysql-client_5.7.42-1ubuntu18.04_amd64.deb \ | |
./mysql-community-server_5.7.42-1ubuntu18.04_amd64.deb \ | |
./mysql-server_5.7.42-1ubuntu18.04_amd64.deb \ | |
./libmysqlclient-dev_5.7.42-1ubuntu18.04_amd64.deb | |
cd - | |
rm -rf /tmp/mysql-install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For Python MySQL and GDAL support | |
apt install -y python3-dev build-essential gdal-bin libgdal-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If the pypi package mysqlclient is already installed we need to do: | |
pip uninstall -y mysqlclient | |
pip install --no-binary mysqlclient mysqlclient |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment