Archive

Articles taggués ‘MySQL’

Mcrypt : Installation

29/02/2024 Comments off

Vous devez compiler PHP avec l’option –with-mcrypt=[DIR] pour activer cette extension. DIR est le dossier d’installation de mcrypt. Assurez-vous de compiler libmcrypt avec l’option –disable-posix-threads .

Note, for Ubuntu, simply installing php5-mcrypt did not get mcrypt to work. You need to execute the following commands as root to enable it:

apt-get install php5-mcrypt
 mv -i /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available/
 php5enmod mcrypt
 service apache2 restart

If you don’t have a /etc/php5/conf.d directory, you can simply only do: php5enmod mcrypt

Should be working fine.

Categories: Système Tags: ,

Configuring Log Rotation of Apache2 and Other Logs

22/02/2024 Comments off

source: lifeonubuntu.com

I went to check out my apache2 logs

ls /var/log/apache2/

and I noticed that they were being automatically rotated (access.log, access.log.1, etc.) and compressed with gzip (access.log.2.gz, etc.). This seems to be the default Ubuntu configuration. I wanted to make find out more, and I found this helpful article about Ubuntu logs, including Apache2 Log info and some basic log rotation info.

After reading through the info, I decided that I wanted to make a few changes. The log rotation happens via the brilliantly named logrotate command. It turns out that logrotate settings kept in 2 places. Lire la suite…

PHP MySQL Benchmark Tool (PMBT v. 0.2)

19/02/2024 Comments off

Source: Reasons Unbeknownst

The old saying “Need is the father of innovation” (or something like that) held true this weekend. I was looking for an easy way to benchmark MySQL for some RAM drive InnoDB experimentation but couldn’t find anything cross platform, user friendly, and created after 2005. So I built an early version of what I was looking for.

This is a very synthetic benchmark for now. In some instances InnoDB is much faster than MyISAM (simultaneous reads/writes) but that doesn’t come across in these results. I’m planning on beefing up the benchmark options in later versions. This tool is currently useful in benchmarking hard drive / RAID performance when using InnoDB. It’s also good for basic my.cnf tweaking. Lire la suite…

Vous avez perdu le mot de passe root de MySQL ?

17/02/2024 Comments off

Que ce soit lors de la première installation ou après la perte du mot de passe principal de MySQL, il est nécessaire de pouvoir modifier le mot de passe administrateur (root) de MySQL.

Pour pouvoir modifier le mot de passe root de MySQL, il faut pouvoir s’y connecter, Or, si vous n’avez pas le mot de passe root actuel, vous vous retrouvez alors dans une situation kafkaïenne. Si vous connaissez le mot de passe actuel de MySQL et que vous souhaitez juste changer le mot de passe root, vous pouvez sauter cette étape ! Lire la suite…

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: ,