判断 mariadb是否存在
rpm -qa|grep mariadb
卸载mariadb
yum -y remove mariadb-libs
安装依赖
yum install -y perl perl-Module-Build net-tools autoconf libaio numactl-libs
上传安装包文件到服务器上
yum -y localinstall mysql-community-*
安装完成之后
systemctl enable mysqld
systemctl start mysqld
systemctl status mysqld
netstat -natp | grep mysql
查看mysql的暂时密码
grep 'temporary password' /var/log/mysqld.log
登录
mysql -uroot -p
输入密码,密码只能隐身输入,可能暂时的密码或有特殊字符
修改密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'ShengunJS#888';
flush privileges;
密码修改完成重新登录