在Linux環(huán)境下安裝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服務(wù)器
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客戶端工具連接服務(wù)器
mysql -u root -p
準備工作
set global validate_password_policy=0;
set global validate_password_length=6;
alter user 'root'@'localhost' identified by '123456';