Skip to content
Snippets Groups Projects
init.md 1 KiB
Newer Older
  • Learn to ignore specific revisions
  • Rémi PAILHAREY's avatar
    Rémi PAILHAREY committed
    # Init first prices data
    
    ## Local
    
    If the script is not working (problem with secure_file_priv variable), use the import in phpMyAdmin:
    
    - Ignore the request for the first line
    - Select format "CVS using LOAD DATA"
    - Choose the right column separator ","
    - Then launch the execution
    
    ## Rec/Prod
    
    - Connect to mysql docker container
    
    ```
    docker exec -it <container-id> bash
    ```
    
    - Open mysql shell
    
    ```
    mysql --local-infile=1 -uroot -p backoffice < /dbinit/dbinit.sql
    
    ```
    
    
    ## OpenShift
    
    - Connect to the database pod via the terminal on the console
    - Go to /var/lib/mysql
    
    ```
    cd /var/lib/mysql
    ```
    
    - Import the two files with curl (you can use temporary hosting solutions like tmpfiles.org)
    
    ```
    curl --output dbinit.sql https://tmpfiles.org/dl/80799/dbinit.sql
    curl --output fluidprices.csv https://tmpfiles.org/dl/80799/fluidprices.csv
    ```
    
    - Execute dbinit.sql script (the password is the cluster secret named "ecolyo-agent-database")
    
    ```
    mysql --local-infile=1 -uroot -p ecolyo-agent-database < /dbinit/dbinit.sql
    ```