install mysql at linux

cd /usr/local
wget http://repo.mysql.com//mysql57-community-release-el7-7.noarch.rpm
rpm -ivh mysql57-community-release-el7-7.noarch.rpm
yum install -y mysql-server
systemctl start mysqld.service
systemctl status mysqld.service
cd /etc and vi my.cnf and add at last line:skip-grant-talbes
mysql
mysql>use mysql;
mysql>update mysql.user set authentication_string=password('yourpasswd') where user='root';
mysql>flush privileges;
mysql>exit;
systemctl start mysqld.service
mysql -u root -p 
enter yourpasswd

 

posted @ 2018-03-05 17:07  随便了888  阅读(126)  评论(0编辑  收藏  举报