标签:mysql mysql5.6.20
1、下载mysql5.6.20
wget http://dldx.csdn.net/fd.php?i=647578207794786&s=4f3a5759b24d9da51def820682899e00
2、安装所需组件
yum -y install gcc gcc-c++ gcc-g77 autoconf automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel* make cmake
3、创建mysql用户
groupadd mysql
useradd -r -g mysql mysql
4、编译mysql
创建数据保存文件夹 mkdir /data
tar zxvf mysql-5.6.20.tar.gz
cd mysql-5.6.20
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data -DSYSCONFDIR=/etc -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock -DMYSQL_TCP_PORT=3306 -DENABLED_LOCAL_INFILE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
make&make install
chown -R mysql.mysql /usr/local/mysql
5、初始化数据库
cd /usr/local/mysql/scripts/
./mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/data
6、注册mysql服务
cp /usr/local/mysql/support-files/mysql.server /etc/rc.d/init.d/mysqld
cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf
chkconfig --add mysqld
chkconfig mysqld on
7、环境变量修改
cd ~
vi .bashrc
加入以下内容
PATH=/usr/local/mysql/bin:$PATH
export PATH
8、配置用户密码和远程访问权限
mysql -uroot
SET PASSWORD = PASSWORD(‘123456‘);
GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘123456‘ WITH GRANT OPTION;
标签:mysql mysql5.6.20
原文地址:http://2860664.blog.51cto.com/2850664/1554639