Welcome to Centmin Mod Community
Become a Member

MariaDB Running Bulk Mysql Queries Effeciently.

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

Tags:
  1. skringjer

    skringjer Member

    144
    17
    18
    Apr 21, 2019
    Ratings:
    +31
    Local Time:
    9:12 AM
    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 Member

    144
    17
    18
    Apr 21, 2019
    Ratings:
    +31
    Local Time:
    9:12 AM
    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

    44,804
    10,216
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,834
    Local Time:
    2:12 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x