Outils pour utilisateurs

Outils du site


informatique:sgbd:mysql

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
informatique:sgbd:mysql [23/01/2020 11:36] – [Create DB & User] cyrilleinformatique:sgbd:mysql [31/10/2022 18:37] (Version actuelle) – [Regular expression] il faut 2 anti-slash pour le ''?'' cyrille
Ligne 17: Ligne 17:
  
 ==== Mysql Workbench ==== ==== Mysql Workbench ====
 +
 +https://dev.mysql.com/downloads/workbench/
  
 Plugins & Scripts : Plugins & Scripts :
Ligne 160: Ligne 162:
 set content = REGEXP_REPLACE(content, '##', '$$') set content = REGEXP_REPLACE(content, '##', '$$')
 where content like '%##%' where content like '%##%'
 +</code>
 +
 +Attention, il faut 2 anti-slash pour le ''?''. Exemple pour supprimer le spam WordPress ''weatherplllatform'':
 +<code sql>
 +update wpci_posts
 +set post_content = REGEXP_REPLACE(
 + post_content ,
 + "<script src='https://new\.weatherplllatform\.com/pick\.js\\?v=11\.87\.33' type='text/javascript'></script>", ''
 + )
 +where post_content like "%weatherplllatform%"
 +
 </code> </code>
  
Ligne 174: Ligne 187:
  
 ===== Replication ===== ===== Replication =====
 +
 +[[/informatique/sgbd/mysql/replication|mysql/replication]]
  
 Articles: Articles:
 +  * [[https://www.it-connect.fr/replication-en-temps-reel-masterslave-mysql%EF%BB%BF/#VII_Simulation_de_panne_recuperation_et_remise_en_ordre_du_master|Réplication en temps réel Master/Slave MySQL]] (2013, Mysql 5.5)
 +    * Et avec une méthode toute simple pour "Simulation de panne, récupération et remise en ordre du master"
 +  * [[https://opensolitude.com/2016/09/12/painless-high-availability-failover-mariadb.html|Painless HA failover with MariaDB]] (2016
 +    * avec Master<->Master
 +    * ''auto_increment_increment'' and ''auto_increment_offset'' variables such that one only uses odd numbers for auto-incrementing integer primary keys and the other use even bumbers
 +    * [[https://fr.wikibooks.org/wiki/MySQL/R%C3%A9plication|MySQL Réplication]]
 +  * [[https://www.christophe-casalegno.com/reparation-dune-replication-mysql-mariadb/|Réparation d’une réplication MySQL ou MariaDB]]
   * [[http://missingmanuals.com/pub/a/onlamp/2006/04/20/advanced-mysql-replication.html?page=1|Advanced MySQL Replication Techniques]] (2006-04-20)   * [[http://missingmanuals.com/pub/a/onlamp/2006/04/20/advanced-mysql-replication.html?page=1|Advanced MySQL Replication Techniques]] (2006-04-20)
   * [[http://www.ovaistariq.net/528/statement-based-vs-row-based-replication/|Statement-based vs Row-based Replication]] (2011-01)   * [[http://www.ovaistariq.net/528/statement-based-vs-row-based-replication/|Statement-based vs Row-based Replication]] (2011-01)
  
 +==== Reprise après échec/panne ====
  
 Sans arrêter le Master avec l'option "--master-data" de mysqldump. Sans arrêter le Master avec l'option "--master-data" de mysqldump.
   * http://dev.mysql.com/doc/refman/5.1/en/replication-howto-mysqldump.html   * http://dev.mysql.com/doc/refman/5.1/en/replication-howto-mysqldump.html
 +
 +==== Superviser la réplication ====
 +
 +
 +  * replication check ?
 +  * slave-skip-errors ?
 +  * [[https://mariadb.com/kb/en/show-replica-status/|show slave status]] (ou SHOW REPLICA]
 +  * SHOW PROCESSLIST; SHOW SLAVE HOSTS;
 +
 +Dans ''/var/log/syslog'' des lignes comme ''...mysqld[123]: 101015 21:11:19 [ERROR] Slave: Error...''
 +
  
 ===== Performance ===== ===== Performance =====
Ligne 189: Ligne 223:
 ==== Articles ==== ==== Articles ====
  
-  * [[http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics|Innodb Performance Optimization Basics]]+ 
 +  * [[http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics|Innodb Performance Optimization Basics]] sur mysqlperformanceblog.com 
 +  * [[https://fr.wikibooks.org/wiki/MySQL/Optimisation|MySQL/Optimisation]] sur wikibooks
   * [[http://hackmysql.com/selectandsort|MySQL Select and Sort Status Variables]]   * [[http://hackmysql.com/selectandsort|MySQL Select and Sort Status Variables]]
 +  * [[http://phpinfo.net/articles/article_optimisation-mysql.html|Optimisation MySQL]] Par Laurent DECORPS sur phpinfo.net
 +  * Official doc:
 +    * [[http://dev.mysql.com/doc/refman/5.0/fr/mysql-optimization.html|MySql optimization]]
 +    * [[http://dev.mysql.com/doc/refman/5.0/fr/tips.html|MySql tips]]
  
 ==== Tips ==== ==== Tips ====
Ligne 197: Ligne 237:
   * With MyISAM tables that have no deleted rows, you can insert rows at the end at the same time that another query is reading from the table. If this is important for you, you should consider using the table in ways that avoid deleting rows. Another possibility is to run **OPTIMIZE TABLE after you have deleted a lot of rows**.   * With MyISAM tables that have no deleted rows, you can insert rows at the end at the same time that another query is reading from the table. If this is important for you, you should consider using the table in ways that avoid deleting rows. Another possibility is to run **OPTIMIZE TABLE after you have deleted a lot of rows**.
  
-==== Comparaison InnoDB BuiltIn vs Plugin ==== 
- 
-Comparaison tpc-c entre la version embarquée de InnoDB et le plugin InnoDB sur une instance Amazon c1.xlarge et du MySQL 5.1.43. Pas de tuning particulier => +100% !!! 
-  * en abscisses, le temps : 20 minutes de mesure avec 10 minutes de chauffe 
-  * en ordonnées, le nombre de transactions 
- 
-{{:informatique:sgbd:mysql_comparaison_innodb_plugin-vs-builtin.png|}} 
- 
-Author: [[http://www.dotdeb.org/|GUI]] 
  
informatique/sgbd/mysql.1579775761.txt.gz · Dernière modification : 23/01/2020 11:36 de cyrille

Sauf mention contraire, le contenu de ce wiki est placé sous les termes de la licence suivante : CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki