install mysql in centos and change passoword

Posted otfsenter

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了install mysql in centos and change passoword相关的知识,希望对你有一定的参考价值。

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 [email protected]: 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的主要内容,如果未能解决你的问题,请参考以下文章

How to install OpenBazaar Server in CentOS7

install python3 env in centos7

centos7 install 安装mysql

`block in replace_gem': Please install the mysql2 adapter: `gem install activerecord-mysql2-adap

Install odoo 11(10) on centos7

centos7 install mariadb