2016-12-29 11:25:39 +01:00
|
|
|
**Cette page a été importée automatiquement de notre ancien wiki mais n'a pas encore été révisée.**
|
|
|
|
|
|
|
|
# Mysql
|
|
|
|
|
|
|
|
### Prérequis
|
|
|
|
|
|
|
|
Installation de [wiki:HowtoMySQL MySQL].
|
|
|
|
|
|
|
|
Installation des librairies de développements MySQL
|
2017-01-14 00:06:38 +01:00
|
|
|
|
2016-12-29 11:25:39 +01:00
|
|
|
~~~
|
2017-01-14 00:06:38 +01:00
|
|
|
# aptitude install libmysqlclient-dev
|
2016-12-29 11:25:39 +01:00
|
|
|
~~~
|
|
|
|
|
|
|
|
### Configuration
|
|
|
|
|
|
|
|
Création de l'utilisateur et de la base de donnée :
|
2017-01-14 00:06:38 +01:00
|
|
|
|
2016-12-29 11:25:39 +01:00
|
|
|
~~~
|
|
|
|
MYSQLPASS=$(perl -e 'print map{("a".."z","A".."Z",0..9)[int(rand(62))]}(1..16)')
|
|
|
|
mysql <<EOF
|
|
|
|
CREATE DATABASE $REDMINE CHARACTER SET utf8;
|
|
|
|
GRANT ALL PRIVILEGES ON $REDMINE.* TO "$REDMINE"@'localhost' identified by '$MYSQLPASS';
|
|
|
|
EOF
|
|
|
|
~~~
|
|
|
|
|
|
|
|
Configuration autologin MySQL de l'utilisateur $REDMINE :
|
2017-01-14 00:06:38 +01:00
|
|
|
|
2016-12-29 11:25:39 +01:00
|
|
|
~~~
|
|
|
|
cat > /home/$REDMINE/.my.cnf <<EOF
|
|
|
|
[client]
|
|
|
|
user = $REDMINE
|
|
|
|
password = $MYSQLPASS
|
|
|
|
EOF
|
|
|
|
~~~
|
2017-01-14 00:06:38 +01:00
|
|
|
|
2016-12-29 11:25:39 +01:00
|
|
|
Correction des droits sur .my.cnf :
|
2017-01-14 00:06:38 +01:00
|
|
|
|
2016-12-29 11:25:39 +01:00
|
|
|
~~~
|
|
|
|
chown $REDMINE: /home/$REDMINE/.my.cnf
|
|
|
|
~~~
|