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内核参数
在末尾增加以下内容:
使配置立即生效: