标签:art pad option 用户和组 etc 编译 inno dir 下载
1.安装编译代码需要的包:
yum list|grep ncurses-devel
yum -y install make gcc-c++ cmake bison-devel ncurses-devel
2.下载MySQL 5.6.35
wget https://cdn.mysql.com//Downloads/MySQL-5.6/mysql-5.6.35.tar.gz
tar zxvf mysql-5.6.35.tar.gz
cd mysql-5.6.35
3.目录创建(-p父目录不存在则创建此目录)
mkdir -p /usr/local/mysql/data
4.编译
cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_DATADIR=/usr/local/mysql/data \
-DSYSCONFDIR=/etc \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock \
-DMYSQL_TCP_PORT=3307 \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DEXTRA_CHARSETS=all \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci
5.安装
make && make install
make clean
6.设置权限
查看是否有mysql用户及用户组
cat /etc/passwd
cat /etc/group
如果没有就添加mysql用户和组
groupadd mysql
useradd -g mysql mysql
修改/usr/local/mysql权限
chown -R mysql:mysql /usr/local/mysql
7.初始化配置
cd /usr/local/mysql
执行初始化配置脚本,创建系统自带的数据库和表
scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql
cp /usr/local/mysql/support-files my.cnf
8.启动数据库
启动的时候需要指定my.cnf(系统默认会先查找/etc/my.cnf)
/usr/local/mysql/bin/mysqld_safe --defaults-file=/usr/local/mysql/my.cnf --user=mysql &
9.修改数据库密码
/usr/local/mysql3307/bin/mysql -uroot
SET PASSWORD = PASSWORD(‘bbgolden‘);
GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘bbgolden‘ WITH GRANT OPTION;
flush privileges;
mysql源码包安装(适用于多个mysql)
标签:art pad option 用户和组 etc 编译 inno dir 下载
原文地址:http://www.cnblogs.com/chenjiangze/p/7363920.html