SQL: November 2009 Archives

my.cnf

user-pic
Vote 0 Votes

參考 gslin 這篇「無論如何都應該修改的 MySQL 預設值
max_connect_errors=100
max_connections=1000
thread_cache_size=200
connect_timeout=20
skip-name-resolve
slave_net_timeout=30

max_connections 太小若連線數滿就會出現 Too many connections
show variables where Variable_name='max_connections'; 可以看目前的值
show status where Variable_name='Threads_cached'; 可以看目前的連線數

MySQL latin1 to UTF-8

user-pic
Vote 0 Votes

from MySQL Server A
mysqldump -uroot -p db_name | sed -e 's/CHARSET=latin1/CHARSET=utf8' -e 's/\\//' | iconv -cfbig5 -tutf8 > db_name.sql

to MySQL Server B
echo SET NAMES utf8; >> new_db_name.sql
cat db_name.sql >> new_db_name.sql
mysql -uroot -p < new_db_name.sql

About this Archive

This page is an archive of entries in the SQL category from November 2009.

SQL: January 2009 is the previous archive.

SQL: April 2010 is the next archive.

Find recent content on the main index or look in the archives to find all content.