安装脚本
#! /bin/bash
# 避免有些机器没安装wget
yum -y install wget
yum -y install setup
yum -y install perl
echo "~~~~~~~~~~~~~~~~~~开始安装mysql~~~~~~~~~~~~~~~~~~~~"
echo "weget下载mysql的repo源..."
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
echo "安装mysql-community-release-el7-5.noarch.rpm包..."
sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm
echo "开始安装mysql-server..."
sudo yum install mysql-server
echo "~~~~~~~~~~~~~~~~~~mysql安装完成,开始安装openjdk~~~~~~~~~~~~~~"
yum install java-1.8.0-openjdk.x86_64
在CentOS服务器中建个sh,直接运行以上脚本。
更改root密码:
mysql
use mysql
update user set password=password('root') where user='root';
修改连接权限
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
设置MySQL数据库表名不区分大小写
在\etc\my.conf中[mysqld]节点下添加以下配置:
lower_case_table_names=1