码迷,mamicode.com
首页 > 数据库 > 详细

linux通过shell离线安装MySQL

时间:2017-08-08 20:07:39      阅读:233      评论:0      收藏:0      [点我收藏+]

标签:star   查看   博客   init.d   groupadd   进一步   离线   x86_64   gre   

Ubuntu16.04 64位安装mysql-5.6.37-linux-glibc2.12-x86_64.tar.gz,记录一下安装的语句,其中sed的用法不熟,以后用到,可以回顾此文。进一步学习sed用法应该查看此博客:http://www.cnblogs.com/dong008259/archive/2011/12/07/2279897.html

#!bin/bash
#program:
#       This Shell Install YunPanSever
#history:
#       2017/08/08 wff first release

tar -zxvf  mysql-5.6.37-linux-glibc2.12-x86_64.tar.gz
sudo cp mysql-5.6.37-linux-glibc2.12-x86_64 /usr/local/mysql -r
sudo cp libaio.so.1.0.1 /lib/x86_64-linux-gnu/
sudo ln -s /lib/x86_64-linux-gnu/libaio.so.1.0.1 /lib/x86_64-linux-gnu/libaio.so.1
sudo groupadd mysql
sudo useradd -r -g mysql mysql
sudo chown -R mysql:mysql /usr/local/mysql/
sudo /usr/local/mysql/scripts/mysql_install_db --user=mysql
sudo chown -R root:root /usr/local/mysql/
sudo chown -R mysql:mysql data
sudo cp support-files/mysql.server /etc/init.d/mysql
systemctl enable mysql.service
service mysql start
ps -ef|grep mysql

sudo ln -s /usr/local/mysql/bin/mysql /usr/local/bin/mysql
sudo ln -s /usr/local/mysql/include /usr/include/mysql

sudo ln -s /usr/local/mysql/lib/libmysqlclient.so.18.1.0  /usr/lib/x86_64-linux-gnu/libmysqlclient.so

sudo ln -s /usr/local/mysql/lib/libmysqlclient.so.18  /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18

 

linux通过shell离线安装MySQL

标签:star   查看   博客   init.d   groupadd   进一步   离线   x86_64   gre   

原文地址:http://www.cnblogs.com/wffos/p/7308221.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!