zoukankan      html  css  js  c++  java
  • install mysql in centos and change passoword

    1- new mysql

    installing mysql by mysql-server

    yum install mysql-server
    

    starting mysql

    systemctl start mysqld
    systemctl status mysqld
    

    changing password for root

    cat /var/log/mysqld.log|grep 'temporary password'
    
    2016-12-01T00:22:31.416107Z 1 [Note] A temporary password is generated for root@localhost: mqRfBU_3Xk>r
    
    mysql -u root -p
    
    then use the password mqRfBU_3Xk>r
    
    ALTER USER 'root'@'localhost' IDENTIFIED BY 'password'; 
    

    given grant to root

    GRANT INSERT, SELECT, DELETE, UPDATE ON *.* TO 'root'@'%';
    

    if create a common user, below:

    CREATE USER 'common'@'%' IDENTIFIED BY 'password';
    

    2- old mysql

    installing mysql locally

    wget https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
    md5sum mysql57-community-release-el7-9.noarch.rpm
    rpm -ivh mysql57-community-release-el7-9.noarch.rpm
    config && make && make install 
    

    changing password

    • edit /etc/my.conf
    [mysqld]
    skip-grant-tables
    
    • inside mysql
    # mysql -u root
    mysql> use mysql;
    mysql> update mysql.user set authentication_string=password('123') where user='root';
    mysql> flush privileges;
    mysql> exit
    
  • 相关阅读:
    一些常用的库[转载]
    《三国演义》很给力演绎60条职场真理
    保证你现在和未来不失业的10种关键技【转载】
    百度面试题
    百度的一到算法i题
    FindMaxDeep
    csinglelink
    FindLongArray
    byte转hex,hex转byte
    获取异常信息
  • 原文地址:https://www.cnblogs.com/otfsenter/p/9092137.html
Copyright © 2011-2022 走看看