linux安装mysql与java环境

yum install java-1.8.0-openjdk

-----第一版------

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

 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 '密码';

你可能感兴趣的:(linux安装mysql与java环境)