Welcome to Centmin Mod Community
Register Now

MariaDB Running Bulk Mysql Queries Effeciently.

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by skringjer, Apr 25, 2020.

Tags:
  1. skringjer

    skringjer NoobMaster69

    196
    23
    18
    Apr 21, 2019
    Ratings:
    +39
    Local Time:
    2:39 PM
    Nginx 1.21.6
    MariaDB 10.3.x
    Greetings everyone, i hope everyone is safe and doing alright in this hard time.

    I wanted to know whats the faster and efficient way of running thousands MySQL Update quries.


    I am doing it directly, which is taking time and creates MySQL load.
     
  2. skringjer

    skringjer NoobMaster69

    196
    23
    18
    Apr 21, 2019
    Ratings:
    +39
    Local Time:
    2:39 PM
    Nginx 1.21.6
    MariaDB 10.3.x
    Here is what i am using, since i have innoDB tables

    Code:
    #!/bin/sh
    echo "This program will update blahblahblah..."
    echo "After starting this program, enter your database password for root"
    DATABASENAME=databasenamehere
    
    mysql -u root -p <<-ENDMARKER
    
     use ${DATABASENAME};
     START TRANSACTION;
    UPDATE
    UPDATE
     COMMIT;
    
    ENDMARKER
    found it on Digitalocean.
     
  3. eva2000

    eva2000 Administrator Staff Member

    49,599
    11,388
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,694
    Local Time:
    7:39 PM
    Nginx 1.21.x
    MariaDB 10.x