centos 安装mysql

时间:2023-11-28 12:15:38

  

wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

rpm -ivh mysql-community-release-el7-5.noarch.rpm 

yum install mysql-community-server

mysql -u root
set password =password('你的密码');

  

忘记密码

vim /etc/my.cnf

mysqld添加
skip-grant-tables mysql -u root use mysql update user set authentication_string = PASSWORD('123') where User='root' flush privileges quit service mysqld restart