Differences

This shows you the differences between two versions of the page.

Link to this comparison view

en:linux:mysql [2011/01/15 18:17]
matthieu created
en:linux:mysql [2011/10/04 21:42] (current)
matthieu
Line 79: Line 79:
 Another way is the reconfigure the package : Another way is the reconfigure the package :
   >dpkg-reconfigure mysql-server-5.1   >dpkg-reconfigure mysql-server-5.1
 +
 +===== Make mysql available remotely =====
 +
 +By default, Mysql is only listening on 127.0.0.1. To make it available to other computers, comment the following line inside ///etc/mysql/my.cnf// :
 +   bind-address          = 127.0.0.1
 +
 +===== Script mysql dump =====
 +Here is a small script ///home/scripts/export_db.sh// to export all databases to a file (which can be archived) :
 +
 +<file>
 +#/bin/sh
 +/usr/bin/mysqldump --defaults-file=/etc/mysql/debian.cnf --all-databases --add-drop-database --result-file=/home/scripts/dump_mysql/all_databases.sql
 +</file>
 +
 +This script use the maintenance account from Debian (debian-sys-maint) and exports all datas into ///home/scripts/dump_mysql/all_databases.sql//.
 +
 +To run automatically the script, you just have to add it to cron, for example by creating ///etc/cron.d/exportdb// :
 +  55 23 * * * root /home/scripts/export_db.sh
 +  
 +:!: It's recommended to protect the access to the exported datas :
 +  chmod og-rx -R /home/scripts/dump_mysql/
 +  
  
 ===== Backup ===== ===== Backup =====
   * /etc/mysql/   * /etc/mysql/
   * /var/lib/mysql/   * /var/lib/mysql/
 +  * /var/log/mysql/ 
 +dump mysql : 
 +  * /etc/cron.d/exportdb 
 +  * /home/scripts/export_db.sh 
 +  * /home/scripts/dump_mysql/all_databases.sql
 ===== Links ===== ===== Links =====
   * [[phpmyadmin]]   * [[phpmyadmin]]
   * http://www.mysql.com/   * http://www.mysql.com/
en/linux/mysql.1295111861.txt.gz · Last modified: 2011/01/15 18:17 by matthieu
Recent changes RSS feed Debian Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki