mysql 5.7 on Centos 7 安装
1、下载并安装MySQL官方的 Yum Repository
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
2、生成空密码
mysqld –initialize-insecure –user=mysql
3、启动mysqld
service mysqld start
mysql -uroot -p 回车登入
>ALTER USER ‘root’@’localhost’ IDENTIFIED BY ‘root’;
>CREATE USER ‘admin’@’%’ IDENTIFIED BY ‘1qaz#EDC’;
>GRANT ALTER,DROP,CREATE,SELECT,INSERT,UPDATE,DELETE ON *.* TO ‘root’@’%’ IDENTIFIED BY ‘root’;
>GRANT ALTER,DROP,CREATE,SELECT,INSERT,UPDATE,DELETE ON *.* TO ‘admin’@’%’ IDENTIFIED BY ‘1qaz#EDC’;
>flush privileges;
卸载
//rpm包安装方式卸载
查包名:rpm -qa|grep -i mysql
删除命令:rpm -e –nodeps 包名
//yum安装方式下载
1.查看已安装的mysql
命令:rpm -qa | grep -i mysql
2.卸载mysql
命令:yum remove mysql-community-server-5.6.36-2.el7.x86_64
查看mysql的其它依赖:rpm -qa | grep -i mysql
//卸载依赖
yum remove mysql-libs
yum remove mysql-server
yum remove perl-DBD-MySQL
yum remove mysql
docker 安装
docker run -itd –name uat303 -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root bunchjesse/mysql5.7