User Tools

Site Tools


unraid:dockers:mysql

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
unraid:dockers:mysql [2021/09/06 17:19] dirkunraid:dockers:mysql [2023/09/22 08:23] (current) – [Adjust Max Connections] dirk
Line 21: Line 21:
   * 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 [[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.   * 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 ===== ===== Load Football pool =====
-  * Go to mysql docker console 
-  * install vim 
-    * <code>apt-get update 
-apt-get install vim</code> 
-  * Edit the conf file to add a directory 
-    * <code>vim /etc/mysql/my.cnf</code> 
-    * add <code>secure-file-priv= /var/lib/mysql</code> 
   * Create csv file   * Create csv file
   * Cyberduck it over to tmp folder on unraid server   * 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>   * 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 directory <code> cp /tmp/2021.csv /var/lib/mysql/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 and use normal commands <code>LOAD DATA LOCAL INFILE "/var/lib/mysql/2021.csv" INTO TABLE games COLUMNS TERMINATED BY ',';+  * 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 vscore = NULL where year = 2021;
 UPDATE games SET hscore = NULL where year = 2021;</code> 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.1630966767.txt.gz · Last modified: by dirk