在Linux环境下安装MySQL - 使用包管理工具(Redhat、CentOS)
- yum install / yum erase / yum update / yum info
安装:yum install -y mariadb mariadb-server
查看:yum list installed | grep mariadb
卸载:yum erase -y mariadb mariadb-server mariadb-libs - rpm -ivh / rpm -e / rpm -qa
下载:wget / tar -xvf
补包:yum install -y libaio
安装:
rpm -ivh mysql-community-common-5.7.26-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.26-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-5.7.26-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-5.7.26-1.el7.x86_64.rpm
启动/停止/重启MySQL服务器
systemctl start mysqld / service mysqld start
systemctl stop mysqld / service mysqld stop
systemctl restart mysqld
systemctl status mysqld
systemctl enable mysqld
netstat -ntlp | grep mysql
cat /var/log/mysqld.log | grep "A temporary password"
通过MySQL客户端工具连接服务器
mysql -u root -p
准备工作
set global validate_password_policy=0;
set global validate_password_length=6;
alter user 'root'@'localhost' identified by '123456';