编程知识 cdmana.com

Installing MySQL under Linux

explain :

•  This document “CentOS7.5” Operating system as an example , Corresponding MySQL Version is 5.6.50
• CentOS 7 And above will MySQL Database software removed from the default program list , To be implemented sudo rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm  Download manually . After downloading, you can click 2 Installation .
  1. Execute the following command , install MySQL database server 、MySQL Client and MySQL Develop the required libraries and included files .
    yum install -y mysql-server mysql mysql-devel
  2. Echo as follows , Description installation successful .
    Complete!
    To configure MySQL
  3. Execute the following command , start-up MySQL service .
    service mysqld start
  4. Execute the following command , Set database administrator account and password . The password is user-defined , With Huawei@123 Take an example to illustrate .
    mysqladmin -u root password 'Huawei@123'
  5. Execute the following command , Then enter the database administrator according to the prompt root The password of the account enters the database .
    mysql -u root -p
  6. Execute the following command , Use MySQL database .
    use mysql
  7. Execute the following command , View the list of users .
    select host,user from user;
    explain :

        This command and the following database statements end with semicolons , Do not ignore .
  8. Execute the following command , Refresh the user list and allow all IP Access to database .
    update user set host='%' where user='root' LIMIT 1;
  9. Execute the following command , Force refresh permissions . Allow cloud servers in the same subnet that are set to be accessible through private IP Yes MySQL Database access .
    flush privileges;
  10. Execute the following command , Exit database .
    quit
  11. Execute the following command , restart MySQL service .
    systemctl restart mysql
  12. Execute the following command , Set the power on auto start MySQL service .
    systemctl enable mysqld
  13. Execute the following command , Turn off firewall .
    systemctl stop firewalld
  14. Execute the following command , Set the firewall to be turned off permanently after the server restarts .
    systemctl disable firewalld

come from https://support.huaweicloud.c...

版权声明
本文为[Leisurely wind]所创,转载请带上原文链接,感谢

Scroll to Top