码迷,mamicode.com
首页 > 数据库 > 详细

install mysql in centos and change passoword

时间:2018-05-26 11:47:15      阅读:181      评论:0      收藏:0      [点我收藏+]

标签:dev   ted   pre   stat   word   mysq   res   cal   rate   

Install mysql

Installing MySQL

Starting MySQL

  • systemctl start mysqld
  • systemctl status mysqld
  • grep ‘temporary password‘ /var/log/mysqld.log

    2016-12-01T00:22:31.416107Z 1 [Note] A temporary password is generated for root@localhost: mqRfBU_3Xk>r

Change password

  • stop mysqld

    ps -ef|grep -i mysql
    systemctl stop mysqld
  • edit /etc/my.conf

vim /etc/my.cnf

[mysqld]
skip-grant-tables
  • change password

    # mysql -u root
    mysql> use mysql;
    mysql> update mysql.user set authentication_string=password(‘123‘) where user=‘root‘;
    mysql> flush privileges;
    mysql> exit
  • comment skip-grant-tables in /etc/my.cnf

  • restart mysql

    systemctl stop mysqld
    systemctl start mysqld

install mysql in centos and change passoword

标签:dev   ted   pre   stat   word   mysq   res   cal   rate   

原文地址:https://www.cnblogs.com/otfsenter/p/9092137.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!