文章目录
aliyun部署
1,登录网址:
http://www.tjhysoft.com.cn/
2,准备目录
# cd /
# mkdir java
# mkdir jdk8 mysql tomcat git redis #同时创建多个目录
3,上传tar包
4,安装jdk
# cd /java/jdk8
# tar -xvf jdk-8u341-linux-x64.tar.gz #解压
# mv jdk-8u341-linux-x64.tar.gz jdk8 #重命名
# vim /etc/profile
export JAVA_HOME=/java/jdk8/jdk8
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
# source /etc/profile
# java -version
5,安装mysql
# cd /java/mysql
# tar -zxf mariadb-10.5.8-linux-x86_64.tar.gz
# mv mariadb-10.5.8-linux-x86_64 mariadb1058 #重命名
# useradd -s /sbin/nologin -M mysql #添加用户组
# chown mysql:mysql -R /java/mysql/mariadb1058 #赋权限
# mkdir data #保存日志
# chown mysql:mysql -R ./data #赋权限
# ./scripts/mysql_install_db --user=mysql --datadir=./data #执行安装脚本
# cp ./support-files/mysql.server /etc/init.d/mysqld
# chmod +x /etc/init.d/mysqld 赋权限
修改配置文件
# vi /etc/init.d/mysqld
basedir=/java/mysql/mariadb1058
datadir=/java/mysql/mariadb1058/data
# echo 'export PATH=/usr/local/mariadb/bin:$PATH' > /etc/profile.d/mysql.sh
# source /etc/profile.d/mysql.sh
# vi /etc/my.cnf
datadir=/java/mysql/mariadb1058/data
添加服务
# chkconfig --add mysqld
# chkconfig mysqld on
防火墙
# systemctl stop firewalld
# systemctl disable firewalld
启动
# ./bin/mysqld_safe --user