Updates to multiple databases - mysql
P粉129731808
P粉129731808 2023-08-27 11:15:21
0
1
474
<p>I am new to mysql. I have a list of 10 databases containing the same table structure. The same table needs to be updated for each database. Is there an option to do it through phpmyadmin without selecting each database? </p> <p>Or is there a function similar to: <code>USE LIKE gc%</code>? </p>
P粉129731808
P粉129731808

reply all(1)
P粉268654873

If you need to update the original data, you can do the transaction like this. You can't escape the fact that you need to make 10 different queries.

START TRANSACTION;
  UPDATE  `db_name1`.`table_01` SET `parameter`=`value` 
    WHERE `parameter`=`value`;
  UPDATE  `db_name2`.`table_01` SET `parameter`=`value` 
    WHERE `parameter`=`value`;
  UPDATE  `db_name3`.`table_01` SET `parameter`=`value` 
    WHERE `parameter`=`value`;
COMMIT;
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template