Centos installed MySQL5.6 and reset the password

Database Configuration

If you are using a built-in sqllite then the database can not move

Installation MySQL5.6 database

Here is strongly recommended to use 5.6, 5.7 version of the database to meet a lot of BUG

Installing MySQL

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 -y

Restart command

service mysqld restart

Set a password for the database

Set does not verify the password, and then restart the server

mysqld --skip-grant-tables
service mysqld restart

Reset the database password

mysql   // 敲入mysql就可以直接进入
use mysql 
update user set password=password("root") where user="root";  //设置密码 ''root ''可以替换成你想设置的其他的密码

Guess you like

Origin www.cnblogs.com/ruhai/p/10995963.html