This is an old revision of the document!
MySQL is an open-source relational database management system. Its name is a combination of “My”, the name of co-founder Michael Widenius's daughter, and “SQL”, the abbreviation for Structured Query Language. Brimble.com uses MySQL to store the tables for most all things running on the server.
I used the official docker mysql:8.4
docker exec -it mysql bash
sudo cp /mnt/backup/xfer/2024.csv /mnt/nvme/appdata/mysql/datalink/
mysql> show global variables like 'local_infile';
mysql> set global local_infile=true;
mysql --local_infile=1 -u root -ppassword DB_name
LOAD DATA LOCAL INFILE "/var/lib/mysql/datalink/2024.csv" INTO TABLE games_nfl COLUMNS TERMINATED BY ','; UPDATE games SET vscore = NULL where year = 2024; UPDATE games SET hscore = NULL where year = 2024;
show processlist;
show variables like '%timeout';
docker cp mysql:/etc/my.cnf .
[mysqld] wait_timeout = 600 interactive_timeout = 600 max_connections = 500
cp my.cnf mysql:/etc/my.cnf
#!/bin/bash
declare -r dockern="mysql"
echo "checking if my.cnf is already updated"
docker exec $dockern grep -q "wait_timeout = 600" /etc/my.cnf && a=1 || a=0
if [ $a == 1 ]
then
echo "it has already been updated... no changes made"
else
echo "it has not been updated... updating my.cnf to include new wait_timeout, interactive_timeout, and max_connection variables"
docker exec $dockern sed -i '/user=mysql/a wait_timeout = 600\ninteractive_timeout = 600\nmax_connections = 500' /etc/my.cnf
echo "done... restarting docker"
sleep 5
docker container restart $dockern
fi
echo "script complete"