Erreur XAMPP : Exception EAccessViolation in module xampp-control.exe at address in module 'xampp-control.exe'. Read of adress
Mot-clé - mysql
mysql fonction pour supprimer les balises html
J'ai eu le même besoins que How to remove html tags except <br> from mysql data?, Remove HTML tags from record et SQL - Remove all HTML tags in a string
Data Types SQL langages de programmation INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT
Quels sont les types SQL et des langages de programmation JAVA, PHP, Javascript, ...
[ERROR] Failed to open the relay log [ERROR] Could not find target log during relay log initialization [ERROR] Initialized Master_info from [ERROR] Failed to create a new master info file [ERROR] Failed to initialize multi master structures - Aborting
Visiblement, suite à changement de configuration réseau DHCP et nom d'hôte, impossible de lancer le serveur MySQL MariaDB.
Puisque je n'avais pas besoin de la réplication,
en modifiant, le my.ini, et rajoutant :
slave_sql_verify_checksum = OFF
et supprimant : master-xxx.info mysql-relay-xxx.index relay-log-xxx.info
le serveur se relance :
[ERROR] mysqld.exe: Index for table '.\mysql\db' is corrupt; try to repair it Couldn't repair table: mysql.db
Aie ! C'est le drame, MySQL / MariaDB ne se lance plus sous mon installation XAMPP, et le fichier de log (mysql\data\mysql_error.log), indique :
[ERROR] mysqld.exe: Table '.\mysql\db' is marked as crashed and should be repaired [ERROR] mysqld.exe: Index for table '.\mysql\db' is corrupt; try to repair it [ERROR] Couldn't repair table: mysql.db [ERROR] Fatal error: Can't open and lock privilege tables: Index for table 'db' is corrupt; try to repair it
SQL "matching found rows" vs "affected rows"
Lors de modifications (UPDATE, DELETE) comment différencier le nombre d'enregistrement qui matche au critère WHERE et le nombre d'enregistrement réellement modifiés par la requête ?
- "found (matched) rows" le nombre d'enregistrements trouvés (potentiellement modifiable)
- "affected (changed) rows" le nombre d'enregistrements véritablement changés parmi les trouvés
MySQL client données des colonnes blob affichée en hexa au lieu de string - binary-as-hex - skip-binary-as-hex
Avec le client MySQL, les données de type blob sont par défaut affichée en hexa au lieu de string.
MySQL variables global session utilisateur
Accès aux variables de status, système, session, globales, utilisateur.
MariaDB variables
Accès aux variables de status, système, session, globales, utilisateur.
Réplication MariaDB
Petites notes sur la réplication avec MariaDB
REPLACE INTO vs ON DUPLICATE KEY UPDATE
Which (non-standard) statement is better faster?
- REPLACE INTO ...
- INSERT INTO ... ON DUPLICATE KEY UPDATE ...
sql occurence char count
Comment compter le nombre d’occurrence d'un caractère dans une colonne ?
SET @string = "Bonjour ""Mr Vinal""; il fait beau l'été, l'automne et l'hivers, n'est ce pas ?"; SELECT SUM( LENGTH(@string ) ) AS total_length, SUM( LENGTH(@string) - LENGTH(replace(@string, ',', '')) ) AS coma_virgule, SUM( LENGTH(@string) - LENGTH(replace(@string, '''', '')) ) AS quote_cote, SUM( LENGTH(@string) - LENGTH(replace(@string, '"', '')) ) AS double_quote_cote, SUM( LENGTH(@string) - LENGTH(replace(@string, ';', '')) ) AS semicolon_point_virgule ; /* +--------------+--------------+------------+-------------------+-------------------------+ | total_length | coma_virgule | quote_cote | double_quote_cote | semicolon_point_virgule | +--------------+--------------+------------+-------------------+-------------------------+ | 79 | 2 | 4 | 2 | 1 | +--------------+--------------+------------+-------------------+-------------------------+ */
The last packet successfully received from the server was X milliseconds ago. The last packet sent successfully to the server was Y milliseconds ago.
The last packet successfully received from the server was X milliseconds ago. The last packet sent successfully to the server was Y milliseconds ago.
MySQL server has gone away
sql_log.sh
Petit script pour activer les logs des requêtes SQL (MariaDB, MySQL).
Usage :
./sql_log.sh OFF
./sql_log.sh ON
tail -f /var/lib/mysql/hostname.log
MySQL create command SELECT/INSERT/UPDATE
Commandes SQL pour générer des statements SELECT, INSERT, REPLACE, UPDATE de vos tables, dans le but d'avoir les requêtes déjà prêtes avec la liste de vos champs.
MariaDB
int max
Quel est le maximum pour un type int ?
Deadlock MySQL
Exception : Deadlock found when trying to get lock; try restarting transaction com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Deadlock found when trying to get lock; try restarting transaction
Exception::getMessage: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction
group http user agent sql
MySQL statement to know distinct browser version previoulsy stored in a table from User-Agent header ($_SERVER['HTTP_USER_AGENT'] with PHP for example).
Représentation intervallaire avec nleft, nright ou lft, rght
Comment gérer un arbre de données sql avec son arborescence ? Avec la représentation intervallaire (tree behavior).
Représentation intervallaire (intervallic representation) comportement arbre (tree behavior)