目录
2、 在Centos7镜像下安装Mysql实现的效果图如下:
1、在Centos7镜像下安装Mysql
1.1 列出自带的mysql依赖库的包
rpm -qa | grep mariadb
mariadb-libs-5.5.68-1.el7.x86_64
2.2 卸载自带的mysql依赖库的包
sudo rpm -e --nodeps mariadb-libs-5.5.68-1.el7.x86_64
3.3 安装新的mysql数据库,并配置相关参数
mkdir mysql
cd mysql
wget https://downloads.mysql.com/archives/get/p/23/file/mysql-5.7.30-1.el7.x86_64.rpm-bundle.tar
[hadoop@analysis01 mysql]$ tar xvf mysql-5.7.30-1.el7.x86_64.rpm-bundle.tar
sudo yum -y install mysql-community-common-*
sudo yum -y install mysql-community-libs-5.7.30-1.el7.x86_64.rpm
sudo yum -y install mysql-community-client-5.7.30-1.el7.x86_64.rpm
sudo yum -y install mysql-community-server-5.7.30-1.el7.x86_64.rpm
systemctl start mysqld.service
systemctl status mysqld.service
sudo cat /var/log/mysqld.log | grep password
mysql -uroot -p
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'Root123$';
mysql> grant all privileges on *.* to 'root'@'%' identified by 'Root123$' with grant option;
mysql> use mysql;
mysql> select host,user from user;
flush privileges; #刷新权限
status; #查看当前状态
exit
[root@hadoop02 usr]# vim /etc/my.cnf
[client]
default-character-set=utf8
#For advice on how to change settings please see
#http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
[mysqld]
#
#Remove leading # and set to the amount of RAM for the most important data
#cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
#innodb_buffer_pool_size = 128M
#
#Remove leading # to turn on a very important data integrity option: logging
#changes to the binary log between backups.
#log_bin
#
#Remove leading # to set options mainly useful for reporting servers.
#
#The server defaults are faster for transactions and fast SELECTs.
#Adju