wget http://cdn.mysql.com//Downloads/MySQL-5.6/mysql-5.6.29.tar.gz tar zxvf mysql-5.6.29.tar.gz cd mysql-5.6.29 cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \ -DDEFAULT_CHARSET=utf8 \ -DDEFAULT_COLLATION=utf8_general_ci \ -DENABLED_LOCAL_INFILE=ON \ -DWITH_INNOBASE_STORAGE_ENGINE=1 \ -DWITH_FEDERATED_STORAGE_ENGINE=1 \ -DWITH_BLACKHOLE_STORAGE_ENGINE=1 \ -DMYSQL_UNIX_ADDR=/tmp/mysqld.sock \ -DWITH_DEBUG=0 \ -DMYSQL_TCP_PORT=3306 # make # make install
4. 配置以及初始化MySQL
# cd /usr/local/mysql
4.1 设置MySQL安装目录的权限
# chown -R mysql:mysql /usr/local/mysql
4.2 初始化MySQL
# scripts/mysql_install_db --user=mysql
# cp support-files/mysql.server /etc/init.d/mysqld
4.3 重新设置MySQL安装目录的权限(除data目录外,其余所有目录及文件均修改用户为root,组不变)
# chown -R root .
# chown -R mysql data
4.4 启动mysql_safe
# bin/mysqld_safe --user=mysql &
4.5 设置MySQL的root帐号密码
- 自动设置:# ./bin/mysql_secure_installation
或
- 手动置:# ./bin/mysqladmin -u root password '<PASSWORDHERE>'
原文链接:Mysql 5.6.16 源码包 (mysql-5.6.16.tar.gz)安装,转载请注明来源!