Exactement ce que je cherchais
You can use the mysql_config_editor utility to store authentication credentials in an encrypted login path file named .mylogin.cnf.
To create a new set of credentials run:
mysql_config_editor set --host=db.host.org --user=dbuser --password
and enter your password when prompted.
This will store your authentication credentials in the default client login path.
You can store multiple authentication credentials by specifying a different --login-path option:
mysql_config_editor set --login-path=db2 --host=db2.host.org --user=dbuser --password
By default, the mysql client reads the [client] and [mysql] groups from other option files, so it reads them from the login path file as well. With a --login-path option, client programs additionally read the named login path from the login path file. The option groups read from other option files remain the same. Consider this command:
mysql --login-path=db2
The mysql client reads [client] and [mysql] from other option files, and [client], [mysql], and [mypath] from the login path file.
To print out all the information stored in the configuration file run:
mysql_config_editor print --all=true
More information about the utility can be found at "mysql_config_editor — MySQL Configuration Utility".
Use ` instead of ' in the database name, and escape the _
GRANT ALL PRIVILEGES ON xian\_%
.* TO xian@'192.168.1.%';
Options interessantes : --quick --single-transaction
Pour un cluster Aurora donné, 3 endpoints :
You can determine which DB instance in an Aurora DB cluster that a connection is connected to by checking the innodb_read_only global variable, as shown in the following example.
SHOW GLOBAL VARIABLES LIKE 'innodb_read_only';
The innodb_read_only variable will be set to ON if you are connected to an Aurora Replica and OFF if you are connected to the primary instance.
mysql -N -e 'show databases' | while read dbname; do mysqldump --complete-insert --routines --triggers --single-transaction "$dbname" > "$dbname".sql; done
todo : regarder les options
To disable bin log for the current session
Dans l'idéal il ne faudrait pas utiliser les paramètres par défauts et lire 100 de la doc pour faire sa propre conf... dans l'idéal.
Peut servir pour auditer les comptes utilisés
Chapter 17 de la doc MySQL : toread
Deux trois fonctions utiles/méconnues côté client
via Skunnyk
Point de vue différents :)
Ici, lorsqu'on utilise "localhost", la connexion va se faire par une socket et lorsqu'on utilise "127.0.0.1", la connexion se fera par tcp. On pourrait se dire que le comportement est anormal, mais en fait, non :
"The patch won't be added as then "localhost" has two meanings - one time meaning "use the unixdomain socket in the default location" and one time actually "resolve localhost and use TCP" as it is taught in many places that "localhost" in MySQL has the first meaning we keep it there."
La socket est déterminée ici dans le php.ini :
; Default socket name for local MySQL connects. If empty, uses the built-in
; MySQL defaults.
mysql.default_socket =
Je me garde ça au chaud, ça peut servir
Todo sur mon dump pour ne plus avoir le warning
MHA performs automating master failover and slave promotion with minimal downtime, usually within 10-30 seconds. MHA prevents replication consistency problems and saves on expenses of having to acquire additional servers. All this with zero performance degradation, no complexity (easy-to-install) and requiring no change to existing deployments.
Problème des caches ARP ? Les clients ont l'adresse MAC du serveur qui est tombé, quand le serveur ne répond pas en face, est-ce que le client va refaire une arp request ? sinon peut-on forcer les clients à le faire ? sinon peut-on utiliser un ARP gratuitous ? Comment de manière sécurisée ?
EDIT : une solution avec les ARP gratuitous : https://devcentral.f5.com/articles/the-limits-of-cloud-gratuitous-arp-and-failover#.UnoP_kO4DRY
Comment mettre en place un slave qui réplique avec percona
Qu'est ce que le sharding ?
Peut servir à scale
Script pour backup toutes ses bases dans des fichiers séparés