1. 程式人生 > 其它 >Install MySQL Community

Install MySQL Community

  1. download RPM:
    1. wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
  2. install RPM :
    1. rpm -ivh mysql57-community-release-el7-11.noarch.rpm
  3. Use Aliyun Mirrors :
    1. wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
  4.   
  5. Clean cache and recache :yum clean all ;yum makecache
  6. Install MySQL :yum -y install mysql-community-server

  7. restart mysql service:systemctl restart mysqld
  8. chacke service status:service mysqld status
  9. use cat or vi /var/log/mysqld.log check mysql auto generate password

    15.login mysql use :mysql -u root -p

    16.change defualt password:set password for root@localhost = password('Your@pwd123');

    17.If you forget password ,you can user select command find it;

    18.About password: if the service error log no temp password ,you must be edit /etc/my.cnf .

    19. vim /etc/my.cnf

    20.skip-grant-tablesAsystemctl restartmysqld