User Tools

Site Tools


unraid:dockers:mysql

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
unraid:dockers:mysql [2021/01/30 12:35] – created dirkunraid:dockers:mysql [2023/09/22 08:23] (current) – [Adjust Max Connections] dirk
Line 20: Line 20:
  
   * User standard SQL commands to import databases from back up, allow privileges, etc.   * User standard SQL commands to import databases from back up, allow privileges, etc.
-  * See Install MySql section of installing ubuntu pages for most commands.  write access is not needed as that feature was removed by changing the way the NCAA pool temp stores the data.+  * See [[unraid:virtual:ubuntu20.04#install_mysql_if_not_using_a_docker|Install MySql]] section of installing ubuntu pages for most commands.  write access is not needed as that feature was removed by changing the way the NCAA pool temp stores the data. 
 + 
 +===== Connect ===== 
 +<code>docker exec -it mysql bash</code> 
 + 
 +===== Load Football pool ===== 
 +  * Create csv file 
 +  * Cyberduck it over to tmp folder on unraid server 
 +  * copy it to tmp folder on docker <code>docker cp /tmp/2021.csv mysql:/tmp/2021.csv</code> 
 +  * go back to docker console, copy it to mysql-files directory <code> cp /tmp/2021.csv /var/lib/mysql-files/2021.csv</code> 
 +  * log into mysql 
 +  * check LOCAL INFILE var <code> mysql> show global variables like 'local_infile';</code> 
 +  * fix it if need be <code> mysql> set global local_infile=true;</code> 
 +  * log out of mysql and back in with proper option <code> mysql --local_infile=1 -u root -ppassword DB_name</code> 
 +  * Use normal commands <code>LOAD DATA LOCAL INFILE "/var/lib/mysql/2021.csv" INTO TABLE games COLUMNS TERMINATED BY ','; 
 +UPDATE games SET vscore = NULL where year = 2021; 
 +UPDATE games SET hscore = NULL where year = 2021;</code> 
 + 
 +===== Adjust Max Connections ===== 
 +  * <code>show processlist;</code> 
 +  * <code>show variables like '%timeout';</code> 
 +  * Either use vs-code setup to edit my.cnf from /etc folder OR copy my.cnf from /etc folder in the docker to the server for editing <code>docker cp mysql:/etc/my.cnf .</code> 
 +  * add following lines to my.cnf (put them just under the [mysqld] line... putting them under [client] is no bueno!<code>[mysqld] 
 + 
 +wait_timeout = 600 
 +interactive_timeout = 600 
 +max_connections = 500</code> 
 +  * copy my.cnf back to docker <code>cp my.cnf mysql:/etc/my.cnf</code> 
 +  * restart docker 
  
unraid/dockers/mysql.1612031739.txt.gz · Last modified: by dirk