首先..
cp /usr/local/share/mysql/my-medium.cnf /etc/my.cnf
如果mysql只開放本機使用的話,在/etc/my.cnf加入
[mysqld]
[...]
bind-address=127.0.0.1
讓mysql只監聽lookback介面
如果不想開socket監聽可以加入
[mysqld]
[...]
skip networking
my.cnf內就有寫到
# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
接下來是備份,mysqldump只能備份沒運作的資料庫
可以利用mysqlhotcopy來熱備份,需要裝mysql-scripts
用法:
mysqlhotcopy –u 帳號 –p 密碼 dbname path
需要一開始就打入密碼...
比較好的方法是在my.cnf加入
[mysqlhotcopy]
user=帳號
password=密碼
然後chmod my.cnf
參考網址:
http://www.real-blog.com/linux-bsd-notes/16
http://douzi.org/wp/archives/46
