标签:led ring ncurses 库文件 ice ble rom gen com
1、安装确保以下系统相关库文件
gcc gcc-c++ autoconf automake zlib* libxml* ncurses-devel libmcrypt* libtool*(libtool-ltdl-devel*)
# yum –y install gcc gcc-c++ autoconf automake zlib* libxml* ncurses-devel libmcrypt* libtool* cmake
2.建立mysql安装目录及数据存放目录
# mkdir /usr/local/mysql # mkdir -p /data/mysql
3.创建用户和用户组
# groupadd mysql
# useradd -g mysql mysql
4.赋予数据存放目录权限
# chown –R mysql.mysql /data/mysql
二、安装MySQL 5.5.35
在mysql.com官网或国内镜像下载源码
# wget http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-5.7.17.tar.gz # tar zxvf mysql-mysql-5.7.17.tar.gz # cd mysql-5.7.17
2.编译mysql-5.7.17
# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_UNIX_ADDR=/tmp/mysqld.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS:STRING=utf8,gbk -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 -DMYSQL_TCP_PORT=3306
如果这一步出现CMake Error at cmake/boost.cmake 则需要在上述配置文件加入
-DDOWNLOAD_BOOST=1 -DWITH_BOOST=/usr/local/boost
当这一步没有任何错误提示,编译并安装
# make # make install
3.初始化数据库
注:
1.之前版本mysql_install_db是在basedir/script下,5.7放在了basedir/bin目录下,且已被废弃
2."--initialize"会生成一个随机密码(~/.mysql_secret),而"--initialize-insecure"不会生成密码
3.--datadir目标目录下不能有数据文件
#/usr/local/mysql/bin/mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql
注:basedir:mysql安装路径 datadir:数据库文件储存路径
4. 设置mysqld的开机启动
#cp support-files/mysql.server /etc/init.d/mysql #chmod 755 /etc/init.d/mysql #chkconfig mysql on
5.为MySQL配置环境变量
将mysql的bin目录加到PATH中,有利于以后管理和维护,在/etc/profile中加入myslq/bin,同时增加两个别名方便操作:
# export PATH=/usr/local/mysql/bin:$PATH # alias mysql_start="mysqld_safe &" # alias mysql_stop="mysqladmin –u root -p shutdown"
6.启动mysql服务
#service mysql start
标签:led ring ncurses 库文件 ice ble rom gen com
原文地址:http://www.cnblogs.com/pandexiong/p/7595654.html