Puisque je développe pas mal sur mon PC en PHP/Perl/Python avec du mysql et que je formate de temps en temps mon PC lors des mises à jour Ubuntu par exemple, j’ai déplacé les sites et fichiers de configuration apache en créant des liens symboliques vers /etc/apache2/conf.d.
J’aimerai faire la même chose avec mysql afin de ne plus perdre mes données, j’ai donc suivi ce tuto : http://case.oncle-tom.net/2008/05/04/modif…-serveur-mysql/
Pour faire simple, il suffit de déplacer le répertoire /var/lib/mysql vers /home/mysql, de vérifier les droits et de changer l’adresse du répertoire dans /etc/mysql/my.conf
J’ai effectué tout correctement (je pense) mais pas moyen de redémarrer mysql :
[codebox]
Dec 12 09:35:26 tethys /etc/init.d/mysql[11464]: 0 processes alive and ‘/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping’ resulted in
Dec 12 09:35:26 tethys /etc/init.d/mysql[11464]: ^G/usr/bin/mysqladmin: connect to server at ‘localhost’ failed
Dec 12 09:35:26 tethys /etc/init.d/mysql[11464]: error: 'Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)'
Dec 12 09:35:26 tethys /etc/init.d/mysql[11464]: Check that mysqld is running and that the socket: ‘/var/run/mysqld/mysqld.sock’ exists!
Dec 12 09:35:26 tethys /etc/init.d/mysql[11464]:
Dec 12 09:39:01 tethys /USR/SBIN/CRON[11754]: (root) CMD ( [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -type f -cmin +$(/usr/lib/php5/maxlifetime) -print0 | xargs -n 200 -r -0 rm)
Dec 12 09:40:01 tethys /USR/SBIN/CRON[11880]: (root) CMD ([ -x /usr/sbin/update-motd ] && /usr/sbin/update-motd 2>/dev/null)
Dec 12 09:40:40 tethys mysqld_safe[12116]: started
Dec 12 09:40:40 tethys mysqld[12119]: 081212 9:40:40 [Warning] Can’t create test file /home/mysql/tethys.lower-test
Dec 12 09:40:40 tethys mysqld[12119]: 081212 9:40:40 [Warning] Can’t create test file /home/mysql/tethys.lower-test
Dec 12 09:40:40 tethys kernel: [ 3596.522853] type=1503 audit(1229071240.502:15): operation=“inode_create” requested_mask=“a::” denied_mask=“a::” fsuid=0 name="/home/mysql/tethys.lower-test" pid=12118 profile="/usr/sbin/mysqld"
Dec 12 09:40:40 tethys kernel: [ 3596.523243] type=1503 audit(1229071240.502:16): operation=“inode_create” requested_mask=“a::” denied_mask=“a::” fsuid=0 name="/home/mysql/tethys.lower-test" pid=12118 profile="/usr/sbin/mysqld"
Dec 12 09:40:40 tethys mysqld[12119]: 081212 9:40:40 InnoDB: Operating system error number 13 in a file operation.
Dec 12 09:40:40 tethys mysqld[12119]: InnoDB: The error means mysqld does not have the access rights to
Dec 12 09:40:40 tethys mysqld[12119]: InnoDB: the directory.
Dec 12 09:40:40 tethys mysqld[12119]: InnoDB: File name ./ibdata1
Dec 12 09:40:40 tethys mysqld[12119]: InnoDB: File operation call: ‘open’.
Dec 12 09:40:40 tethys mysqld[12119]: InnoDB: Cannot continue operation.
Dec 12 09:40:40 tethys kernel: [ 3596.565622] type=1503 audit(1229071240.546:17): operation=“inode_permission” requested_mask=“rw::” denied_mask=“rw::” fsuid=112 name="/home/mysql/ibdata1" pid=12118 profile="/usr/sbin/mysqld"
[/codebox]
Pour les droits :
bob@tethys:/$ ls -il
2 drwxr-xr-x 6 root root 4096 2008-12-12 09:31 home
bob@tethys:/home$ ls -il
311419 drwxr-xr-x 8 mysql mysql 4096 2008-12-12 09:42 mysql
bob@tethys:/home/mysql$ ls -il
total 20572
3096642 -rw-r--r-- 1 mysql mysql 0 2008-10-24 16:06 debian-5.0.flag
5161087 -rw-rw---- 1 mysql mysql 10485760 2008-12-12 09:29 ibdata1
3096643 -rw-rw---- 1 mysql mysql 5242880 2008-12-12 09:29 ib_logfile0
3588120 -rw-rw---- 1 mysql mysql 5242880 2008-09-01 10:33 ib_logfile1
311420 drwx------ 2 mysql mysql 20480 2008-09-28 12:25 joomla
311695 drwx------ 2 mysql mysql 12288 2008-09-29 15:03 joomla_beta
311696 drwxr-xr-x 2 mysql mysql 4096 2008-10-24 16:06 mysql
319599 -rw------- 1 mysql mysql 6 2008-10-24 16:06 mysql_upgrade_info
311697 drwx------ 2 mysql mysql 4096 2008-11-29 10:14 sunelio
311698 drwx------ 2 mysql mysql 4096 2008-12-11 14:47 usvn
311699 drwx------ 2 mysql mysql 4096 2008-10-03 12:14 wordpress
Suis-je passé à coté de quelque chose ?