转载自博客园,感谢博主:http://www.cnblogs.com/wangxin-king/p/5935628.html
今天在阿里云服务器上搭建MysqL服务遇到的坑很多下是基本步骤!
一:卸载旧版本
二:安装编译代码需要的包
yum -y install make gcc-c++ cmake bison-devel ncurses-devel
tar zxvf MysqL-5.6.33.tar.gz cd MysqL-33/ cmake -DCMAKE_INSTALL_PREFIX=/usr/local/MysqL -DMysqL_DATADIR=/data/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=/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
cd /usr/local/MysqL
export PATH=/usr/local/MysqL/bin:$PATH
source /etc/profile
MysqL -uroot
MysqL> SET PASSWORD = PASSWORD('123456');
MysqL> GRANT ALL PRIVILEGES ON *.* TO root'@%' IDENTIFIED BY 'password' WITH GRANT OPTION;
FLUSH PRIVILEGES;
vim /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p -dport 3306 -j ACCEPT
service iptables restart