Archive

Archives pour 09/2022

MySQL show users – how to show the users in a MySQL database

30/09/2022 Comments off

MySQL

To show/list the users in a MySQL database, first log into your MySQL server as an administrative user, then run this MySQL query:

select * from mysql.user;

This MySQL query shows a large listing of MySQL user information, including user permission information, so you may want to trim down some of the fields to display. You can get a listing of the fields in the mysql.user table by running this command:

desc mysql.user;

Lire la suite…

Categories: Bases de données Tags: ,

MySQL – Chargement d’un fichier texte dans une table

30/09/2022 Comments off

Pour charger une fichier texte défini comme suit :

$ tail /home/user1/test.txt
   'nom1',1,9
   'nom2',2,3
   'nom3',3,54
   'nom4',4,2
   'nom5',5,9

Dans une table définie comme suit :

CREATE TABLE chargertest (
                cle_prim int(11) NOT NULL auto_increment,
                nom varchar(20),
                x integer,
                y integer,
                z timestamp(14),
                Constraint pk_chargertest PRIMARY KEY  (cle_prim)
);

A noter que le champ ‘z’ n’est pas défini au niveau du fichier texte et que le séparateur utilisé est ‘,’.

mysql> load data infile '/home/user1/test.txt' into table chargertest fields terminated by ',' (nom,x,y);

 

Categories: Bases de données Tags: ,

Increase upload size in your php.ini

29/09/2022 Comments off

note: increasing PHP upload size is different from increasing PHP memory limit. You can learn to increase memory limit here.

Drupal’s limits on upload file size are determined by your server’s PHP settings (as well as Drupal specified settings that can be set at Admin > Site Configuration > File Upload). The default values for PHP will restrict you to a maximum 2 MB upload file size.

On the settings page for the upload module, Drupal calculates and displays the maximum file size that you can set based upon two PHP settings: ‘post_max_size’ and ‘upload_max_filesize’. Since ‘post_max_size’ is the limit for all the content of your post, many people choose ‘post_max_size’ to be a multiple of ‘upload_max_filesize’ to allow multiple files to be uploaded, but this is not essential. The upload module limits the size of a single attachment to be less than either post_max_size, or upload_max_filesize, whichever is smaller. The default PHP values are 2 MB for upload_max_filesize, and 8 MB for post_max_size.
Lire la suite…

Categories: Logiciel Tags: , ,