Archive

Articles taggués ‘database’

Requête SQL pour trouver les doublons d’une table MySQL

11/02/2024 Comments off

Comment trouver les doublons d’une table avec une requête SQL dans une base de données MySQL ?

Pour vérifier la présence ou l’absence de doublon dans une colonne d’une table MySQL, il existe une reqûete SQL permettant d’éviter de lire « manuellement » les données.

Compter les valeurs et trouvers les comptes supérieur à 1

SELECT COUNT( nom) , nom
FROM  `Matable`
GROUP BY nom
HAVING COUNT( nom) >1

L’exécution de cette requête affichera les noms présents plus d’une fois dans le domaine.

Categories: Bases de données Tags: ,

How to reset the administrator password in ISPConfig 3 ?

10/02/2024 Comments off

Source: faqforge.com

If you lost your ISPConfig 3 administrator password, you can reset it with the following SQL query.

UPDATE sys_user SET passwort = md5(‘admin’) WHERE username = ‘admin’;

The SQL query sets the password to “admin” for the user “admin”, it has to be executed in the ISPConfig mysql database, e.g. with phpmyadmin. If you dont have phpmyadmin installed, then the query can be executed with the mysql commandline utility as well:

Login to the mysql database.

mysql -u root -p

and enter the password of the mysql root user. To switch to the ISPConfig database, run this command:

use dbispconfig;

Now execute the SQL command:

UPDATE sys_user SET passwort = md5(‘admin’) WHERE username = ‘admin’;

and close the mysql shell:

quit;

Monitoring Ubuntu Desktops and Servers Using Monit

08/02/2024 Comments off

monit is a utility for managing and monitoring, processes, files, directories and devices on a UNIX system. Monit conducts automatic maintenance and repair and can execute meaningful causal actions in error situations.

Monit Features

  • Daemon mode – poll programs at a specified interval
  • Monitoring modes – active, passive or manual
  • Start, stop and restart of programs
  • Group and manage groups of programs
  • Process dependency definition
  • Logging to syslog or own logfile
  • Configuration – comprehensive controlfile
  • Runtime and TCP/IP port checking (tcp and udp)
  • SSL support for port checking
  • Unix domain socket checking
  • Process status and process timeout
  • Process cpu usage
  • Process memory usage
  • Process zombie check
  • Check the systems load average
  • Check a file or directory timestamp
  • Alert, stop or restart a process based on its characteristics
  • MD5 checksum for programs started and stopped by monit
  • Alert notification for program timeout, restart, checksum, stop resource and timestamp error
  • Flexible and customizable email alert messages
  • Protocol verification. HTTP, FTP, SMTP, POP, IMAP, NNTP, SSH, DWP,LDAPv2 and LDAPv3
  • An http interface with optional SSL support to make monit accessible from a webbrowser

Lire la suite…

MySQL – Monitorer le port 3306

04/02/2024 Comments off

Pour faire le monitoring du port 3306 sous Linux il suffit d’utiliser la commande :

tcpdump  -i eth0 -nN -vvv -xX  -s 1500  port 3306

s représente la longueur du paquet.

MySQL – Optimisation

31/01/2024 Comments off

L’optimisation au niveau de MySQL passe par trois composants, à savoir :

  • Optimisation du serveur MySQL
  • Optimisation de la base de données
  • Optimisation des requêtes Lire la suite…