yum install java-1.8.0-openjdk
cd /usr
mkdir java
tar -zxvf /home/down/jdk-8u201-linux-x64.tar.gz
vi /etc/profile
#java path config
export JAVA_HOME=/usr/java/jdk1.8.0_201
export CLASSPATH=.:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/lib/dt.jar:${JAVA_HOME}/lib/tools.jar
export PATH=$PATH:${JAVA_HOME}/bin
source /etc/profile
java -version
-----第一版------
yum install mysql-server
service mysqld start
chkconfig mysqld on
/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
/etc/rc.d/init.d/iptables save
use mysql;
update user set password=password('密码') where user='root';
grant all privileges on *.* to 'root'@'%' identified by '密码' with grant option;
flush privileges;
service mysqld restart
----第二版------
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql57-community-release-el7-10.noarch.rpm
rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
yum -y install mysql-community-server
systemctl start mysqld.service
service mysqld status
systemctl enable mysqld
grep 'temporary password' /var/log/mysqld.log
mysql -uroot -p
alter user user() identified by "密码";
use mysql;
grant all privileges on *.* to 'root'@'%' identified by '密码' with grant option;
flush privileges;
vi /etc/my.cnf 添加 character-set-server=utf8
---------------------------------新建数据库用户授权----------------------------------------
create user '用户'@'%' identified by '密码';
grant all privileges on 数据库名.* to 用户@'%' identified by '密码';