首页 > 数据库技术 > 详细

install mysql in centos and change passoword

时间:2018-05-26 11:27:08      阅读:226      评论:0      收藏:0      [点我收藏+]

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

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!