#CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3 -felide-constructors -fno-exceptions -fno-rtti -fomit-frame-pointer -ffixed-ebp"
#./configure --prefix=/usr/local/mysql --enable-assembler --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static --with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock --with-charset=utf8 --with-collation=utf8_general_ci --with-extra-charsets=all
#./configure --prefix=/opt/mysql --enable-assembler --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static --with-unix-socket-path=/opt/mysql/tmp/mysql.sock --with-charset=utf8 --with-collation=utf8_general_ci --with-extra-charsets=all
#make -j2;make install;
# adduser mysql
# ./usr/local/mysql/bin/mysql_install_db
Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
# chmod 700 share/mysql/mysql.server
# adduser mysql
# mkdir /opt/script -p
#cd
/usr/local/mysql/bin/mysqladmin -u root password 'new-password'
/usr/local/mysql/bin/mysqladmin -u root -h localhost.localdomain password 'new-password'
Alternatively you can run:
/usr/local/mysql/bin/mysql_secure_installation
You can start the MySQL daemon with:
cd /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /usr/local/mysql/mysql-test ; perl mysql-test-run.pl
#edit /root/.bashrc
vi /root/.bashrc
type those at the end
/usr/local/mysql/bin/mysql_secure_installation
### install google perftools
tar zxvf google-perftools-1.0
cd google-perftools-1.0
./configure --prefix=/opt/google-perftools && make -j2 && make install
echo /opt/google-perftools/lib >> /etc/ld.so.conf
ldconfig -v
vi mysql_config.sh
### config mysql
mysqld_bin_path='/usr/local/mysql/bin/mysqld_safe'
mysql_config_line=`cat -n $mysqld_bin_path | grep '# executing mysqld_safe' | awk '{ print $1}'`
sed -ie ''$mysql_config_line' a\
export LD_PRELOAD=/opt/google-perftools/lib/libtcmalloc.so' $mysqld_bin_path
/etc/init.d/mysql restart
### verify
/usr/sbin/lsof -n | grep tcmalloc
# *** message like below ***
# mysqld 13380 mysql mem REG 8,3 1663600 3860989 /opt/google-perftools/lib/libtcmalloc.so.0.0.0
#
2009年5月19日 星期二
MySQL安裝優化篇
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言