Difference between revisions of "User talk:Stephdl"

From SME Server
Jump to navigationJump to search
Line 1: Line 1:
 +
voir smeserver-mediawiki.src.rpm
 +
 
http://wiki.contribs.org/SME_Server:Documentation:QA:Verification
 
http://wiki.contribs.org/SME_Server:Documentation:QA:Verification
 
*ajouter un utilisateur
 
*ajouter un utilisateur

Revision as of 20:58, 4 May 2013

voir smeserver-mediawiki.src.rpm

http://wiki.contribs.org/SME_Server:Documentation:QA:Verification

  • ajouter un utilisateur
db accounts setprop toto Shell /bin/bash
signal-event user-modify toto
  • empecher indexer repertoire
db accounts setprop toto Indexes disabled
signal-event ibay-modify toto
  • PWD=$(cat /etc/ldap.secret)
  • yum --enablerepo smecontribs install cgminer
cgminer -o contribs.org:8332 -u myident -p x
screen -S cgminer -t cgminer -dm cgminer -o contribs.org:8332 -u myident -p x

If you want to make it start automatically and run in the background you can do the following:

screen -S cgminer -t cgminer -dm cgminer -o contribs.org:8332 -u myident -p x

then connect to it with:

screen -x

and disconnect from it with:

CTRL-A, CTRL-D


Commençons par le cas de la création d'un DBA avec accès depuis votre réseau local. Ceci est fort utile si vous souhaitez administrer votre serveur MySQL à partir d'une autre machine de votre réseau (il existe de sympathiques interfaces graphiques qui simplifient la vie). Je supposerais ici que l'adresse de votre réseau est 192.168.10.0/255.255.255.0 ; vous pouvez même spécifier une adresse IP en particulier, pour plus de sécurité (dans ce cas, le masque serait 255.255.255.255) :

mysql> GRANT ALL PRIVILEGES ON *.* TO 'nouveau_dba'@'192.168.10.0/255.255.255.0' IDENTIFIED BY 'mot_de_passe' WITH GRANT OPTION; Query OK, 0 rows affected (0.01 sec)

Nota : l'option "WITH GRANT OPTION" n'est pas indispensable et doit être évitée à chaque fois que c'est possible. Elle n'est présentée ici que pour être conforme aux droits que doit avoir un DBA (voir la documentation s'y rapportant pour plus d'informations).

Autre cas, création d'un utilisateur standard avec accès local sur une base de données existante (très utile pour les scripts PHP, notamment) :

mysql> GRANT SELECT, UPDATE, INSERT, DELETE ON base_de_données.* TO 'nouvel_utilisateur'@'localhost' IDENTIFIED BY 'mot_de_passe'; Query OK, 0 rows affected (0.01 sec)

Nota : ne modifiez pas le paramètre 'localhost'.

Il existe bien entendu de multiples variations et combinaisons, mais les deux cas que je viens de vous présenter correspond à l'immense majorité des besoins des utilisateurs sur SME.

Après la création de nouveaux utilisateurs, vous devez indiquer à MySQL de les prendre en compte et, ensuite, quitter le client :

mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec)

mysql> QUIT; Bye

  • To limit access to foo.
config setprop foo PublicAccess OPTION

OPTION is either of the following.

       none             => No access
       local            => Local network  (no password required)
       local-pw         => Local network  (password required)
       global           => Entire Internet(no password required)
       global-pw        => Entire Internet(password required)
       global-pw-remote => Entire Internet(password required outside local network)

automysqlbackup

i'm testing, not ready yet

starting

wget http://sourceforge.net/projects/automysqlbackup/files/latest/download
tar xvf automysqlbackup-v3.0_rc6.tar.gz 
mkdir /etc/automysqlbackup
mv  automysqlbackup.conf /etc/automysqlbackup
mv automysqlbackup /usr/local/bin
chmod +x /usr/local/bin/automysqlbackup
mkdir /var/backup
cp /etc/automysqlbackup/automysqlbackup.conf /etc/automysqlbackup/myserver.conf
nano /etc/automysqlbackup/myserver.conf
nano /etc/cron.daily/runmysqlbackup
#!/bin/sh

/usr/local/bin/automysqlbackup /etc/automysqlbackup/myserver.conf

chown root.root /var/backup/db* -R
find /var/backup/db* -type f -exec chmod 400 {} \;
find /var/backup/db* -type d -exec chmod 700 {} \;
chmod +x /etc/cron.daily/runmysqlbackup

modification myserver.conf

nano /etc/automysqlbackup/myserver.conf
CONFIG_mysql_dump_username='root'
CONFIG_mysql_dump_password='your password'

your mysql password is in the file /root/.my.cnf

CONFIG_db_names=()
CONFIG_db_month_names=()

to launch the script

automysqlbackup /etc/automysqlbackup/myserver.conf

error with 'du' in the script

you can have this error

###### WARNING ######
Errors reported during AutoMySQLBackup execution.. Backup failed
Error log below..
du: WARNING: use --si, not -H; the meaning of the -H option will soon
change to be the same as that of --dereference-args (-D)

see lines 1972

nano /usr/local/bin/automysqlbackup

 echo `du -hs --si "${CONFIG_backup_dir}"`


  1. mysql --user=username --pass=password --host=dbserver database < /path/file.sql
  2. or
  3. mysql --user=username --pass=password --host=dbserver -e "source /path/file.sql" database
  4. NOTE: Make sure you use "<" and not ">" in the above command because
  5. you are piping the file.sql to mysql and not the other way around.
  6. Lets hope you never have to use this.. :)