1:cmake -DCMAKE_INSTALL_PREFIX=/opt/mysql -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS:STRING=all -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DENABLED_LOCAL_INFILE=1 -DMYSQL_DATADIR=/data/mysql -DMYSQL_USER=mysql-test/
2: sudo make && sudo make install
cd /opt/mysql/scripts sudo ./mysql_install_db --basedir=/opt/mysql --datadir=/data/mysql/data --user=mysql
3:sudo cp my-medium.cnf /etc/my.cnf
apt-get install php5curl
4:sudo cp mysql.server mysqld
修改basedir=/usr/local/mysql
datadir=/var/mysql/data
mv mysqld /etc/init.d/mysqld
启动异常的话 检查是否有这个目录
mkdir -p /var/log/mysql/
http://www.tokoner.com/?p=69
phpMyAdmin出现#2002 无法登录 MySQL 服务器
ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock
---------------------------------------------------------
phpmyadmin
要将 config.inc.php 中
$cfg['Servers'][$i]['host'] = ’localhost’;
改成 $cfg['Servers'][$i]['host'] = '127.0.0.1';
修改 ulimit
http://blog.rebill.info/archives/modify-ubuntu-ulimit-restrictions.html
优化内核
优化Linux内核参数
在末尾增加以下内容:
net.ipv4.tcp_max_syn_backlog = 65536
net.core.netdev_max_backlog = 32768
net.core.somaxconn = 32768
net.core.wmem_default = 8388608
net.core.rmem_default = 8388608
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 2
net.ipv4.tcp_tw_recycle = 1
#net.ipv4.tcp_tw_len = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_mem = 94500000 915000000 927000000
net.ipv4.tcp_max_orphans = 3276800
#net.ipv4.tcp_fin_timeout = 30
#net.ipv4.tcp_keepalive_time = 120
net.ipv4.ip_local_port_range = 1024 65535
使配置立即生效:
参考:http://181054867.iteye.com/blog/614640
http://blog.s135.com/nginx_php_v6/