June 2, 2015, 10:41 p.m.
最近发现MySQL官网上出现了一种原生支持json的mysql版本,在http://labs.mysql.com/ ,选那个json。目测bin包推荐el6系统, 遂在阿里云买了个按量计费的ECS,准备花一块钱体验下, 效果不错还实惠。
经过一番折腾,写了如下安装脚本,有需要拿走
gist:https://gist.github.com/fooling/28a5db37e7cd60375f81
懒得点或者被墙了可以直接复制下面
#!/bin/bash
tar zxvf mysql-5.7.7-labs-json-linux-el6-x86_64.tar.gz
path=`pwd`
root_path=$path/mysql-5.7.7-labs-json-linux-el6-x86_64
mkdir /opt/mysql
mkdir /opt/mysql/mysql
mkdir /opt/mysql/mysql/data
useradd mysql
usermod -a -G root mysql
chown -R mysql:mysql $root_path
chown -R mysql:mysql /opt/mysql
mkdir /var/run/mysqld
chown -R mysql:mysql /var/run/mysqld
ln -s $root_path/lib /var/lib/mysql
ln -s $root_path /usr/local/mysql
ln -s $root_path/bin/mysql /usr/local/bin/mysql
echo "installing environment"
$root_path/bin/mysql_install_db --datadir=/opt/mysql/mysql/data
ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
echo "done"
echo "Starting mysql process..."
$root_path/bin/mysqld --user=mysql --datadir=/opt/mysql/mysql/data --basedir=$root_path 0<&- &>/dev/null &
while : ; do
res=`netstat -tanp | grep 3306`
if [ $? -eq 1 ] ;then
sleep 1
else
echo "mysqld process is up"
break
fi
done
echo "done"
echo "initiating mysql's root default password..."
$root_path/bin/mysql_secure_installation
echo "done"
echo "success!"
好用记得点赞。其实还写了个测评的markdown。。估计也没人需要 暂时不放出来了。
这个MySQL版本挺有意思的,希望早日加入release