Mysql database installation for developers, is we will inevitably face the problem, its installation process is not complicated, and the network installation tutorials are also very many, but for beginners, a variety of different forms of installation tutorials, and brought to the novice to choose which way to install the problem, And many times according to the tutorial has not been able to install successfully, installation process appears all kinds of errors.

Mysql > install Mysql on Linux(Centos 7)

Mysql > install Mysql

1. Download the installation package required by MySQL

Address: dev.mysql.com/downloads/m…

CentOS is based on Red Hat.Select OS Version from Linux 7

3. Select RPM Bundle and click Download

4. Click No thanks, just start my download. To download

5. After downloading, use Xshell to connect to our VIRTUAL machine.

6. Through the RPM – qa | grep mariadb command to see mariadb installation package

7. Run the RPM -e mariadb-libs-5.5.60-1.el7_5.x86_64 –nodeps command to uninstall mariadb

Note: The mariadb-libs-5.5.60-1.el7_5.x86_64 name can be changed based on actual conditions

8. Through the RPM – qa | grep mariadb command again check mariadb installation package

9. Run the CD /usr/local/ command to access the local directory in the usr directory of the root directory, which stores local shared resources

10. Run ll to view the directory structure under the current directory

11. Run the mkdir mysql command to create a directory named mysql in the current directory

12. Run the ll command to check the directory structure under the current directory. The newly created mysql directory is available

13. Run the CD mysql command to access the mysql directory

14. Run ll to view the directory structure under the current directory

15. Use XFTP to upload the mysql installation package to the mysql directory

16. Run ll to view the directory structure in the current directory

17. Run the tar -xvf mysql-8.0.23-1.el7.x86_64. RPM -bundle.tar command to decompress the tar package

18. Run the RPM -ivh mysql-community-common-8.0.23-1.el7.x86_64. RPM –nodeps –force command to install common

19. Run the RPM -ivh mysql-community-libs-8.0.23-1.el7.x86_64. RPM –nodeps –force command to install the libs

20. Run the RPM -ivh mysql-community-client-8.0.23-1.el7.x86_64. RPM –nodeps –force command to install the client

21. Run the RPM -ivh mysql-community-server-8.0.23-1.el7.x86_64. RPM –nodeps –force command to install the server

22. Through the RPM – qa | grep mysql command to see the mysql installation package

23. Run the following command to initialize and configure the mysql database

Here’s a special note: We know that Linux is case sensitive by default. To change this, we need to change lower_case_table_names before initialization. Mysql8.0 requires that we cannot change the value of lower_case_table_names after initialize, which means that changing the my.cnf file will not work.

Before the initialization, modify the my. CNF file in Linux, add lower-case-table-names=1 to the [mysqld] configuration node, and run the following command:

mysqld --initialize;
chown mysql:mysql /var/lib/mysql -R;
systemctl start mysqld.service;
systemctl enable mysqld;
Copy the code

Check out the MySQL official documentation:

  • 5.7 the official document: Identifier Case Sensitivity:dev.mysql.com/doc/refman/…
  • 8.0 the official document: Identifier Case Sensitivity:dev.mysql.com/doc/refman/…

MySQL 8.0 Release Notes – Changes in MySQL 8.0.17 (2019-07-22, General Availability – Functionality Added or Changed

In MySQL 8.0, the lower_case_table_names variable can only be configured when the MySQL server is initializ
Copy the code

24. Through the cat/var/log/mysqld log | grep password command to check the database password

25. Run mysql -uroot -p to enter the database login page

26. Enter the password you just found and log in to the MySQL database. Just copy and paste it

27. Run ALTER USER ‘root’@’localhost’ IDENTIFIED WITH mysql_native_password BY ‘123456’; Command to change the password

28. Through the exit; Command to exit MySQL and log in again with the new password

29. Run the following command to authorize remote access

create user 'root'@The '%' identified with mysql_native_password by '123456';
grant all privileges on *.* to 'root'@The '%' with grant option;
flush privileges;
Copy the code

ALTER USER ‘root’@’localhost’ IDENTIFIED BY ‘123456’ PASSWORD EXPIRE NEVER; Command to modify the encryption rules, MySql8.0 version and 5.0 encryption rules are not the same, and now the visualization tool only supports the old encryption.

31. By Flush PRIVILEGES; Command to refresh the modified permission

32. Through the exit; Exit MySQL.

33. Run the following command to disable the Firewall

systemctl stop firewalld.service;
systemctl disable firewalld.service;
systemctl mask firewalld.service;
Copy the code

34. Run the yum -y install iptables-services command to install the iptables firewall

35. Run the following command to configure the firewall

systemctl enable iptables;
systemctl start iptables;
Copy the code

36. Run the vim /etc/sysconfig/iptables command to edit the firewall and add ports

37. Press I to enter insert mode

38. In the relevant place, write the following

-A INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT -A INPUT -m state –state NEW -m tcp -p tcp –dport 3306 -j ACCEPT -A INPUT -m state –state NEW -m tcp -p tcp –dport 443 -j ACCEPT -A INPUT -m state –state NEW -m tcp -p tcp –dport 8080 -j ACCEPT -A INPUT -m state –state NEW -m tcp -p tcp –dport 8090 -j ACCEPT -A INPUT -m state –state NEW -m tcp -p tcp –dport 5888 -j ACCEPT

Press ESC to exit the insertion mode, press:, enter wq, and press Enter to save and exit. : is in English

39. Run the systemctl restart iptables.service command to restart the firewall for the configuration to take effect

40. Run the systemctl enable iptables.service command to start the firewall

41. Run the ifconfig command to check the IP address. After obtaining the IP address, we can connect to our installed mysql through mysql tool.

Mysql > uninstall Mysql

1. Close mysql

service mysqld stop
Copy the code

2. Check the installed mysql

rpm -qa|grep -i mysql
Copy the code

3. Uninstall mysql

RPM -ev mysql-community-client-8.0.11-1.el7.x86_64 --nodeps RPM -ev mysql-community-common-8.0.11-1.el7.x86_64 --nodeps RPM -ev mysql-community-server-8.0.11-1.el7.x86_64 --nodeps RPM -ev mysql-community-libs-8.0.11-1.el7.x86_64 --nodepsCopy the code

4. Delete the mysql directory

find / -name mysql
[root@niceyoohw conf]# rm -rf /var/lib/mysql/
[root@niceyoohw conf]# rm -rf /usr/lib64/mysql
[root@niceyoohw conf]# rm -rf /etc/selinux/targeted/active/modules/100/mysql
[root@niceyoohw conf]# rm -rf /etc/selinux/targeted/tmp/modules/100/mysql
Copy the code

5, delete my.cnf

rm -rf /etc/my.cnf
Copy the code

6. Check the uninstallation

rpm -qa|grep -i mysql
Copy the code

If no, the uninstallation is complete.

Reference article:

.net Core deployed to Linux (CentOS) most complete solution, general chapter

.net Core Deployment for Linux (CentOS) Supervisor+Nginx

Docker+Nginx or Jexus

.net Core deployment to Linux (CentOS) most complete solution, into the devil (using Docker+Jenkins to achieve continuous integration, automatic deployment)

This article covers the use of Virtual machine VirtualBox and Linux

Common Linux commands are required for development

New cross-platform version. NET agile development framework -RDIFramework.NET5.0 shock release

RDIFramework.NET Web Edition Report Management – Power efficient smart charts for enterprises

RDIFramework.NET agile development framework facilitates the development and implementation of ENTERPRISE BPM business process systems

Integrate instant messaging (IM) through SignalR technology. NET agile development framework landing

RDIFramework.NET WinForm added report management function module

RDIFramework.NET Added notification and system news modules to WinForm

RDIFramework.NET – Based. NET rapid information system development framework – series directory

RDIFramework.NET Agile development framework ━ Workflow components

Wechat public number development series – play wechat development – catalog summary

NET Core is the most complete solution for deploying to Windows IIS

Common Linux commands are required for development


Over the years, thanks to supporters and users of the RDIFramework.NET framework, you can find out more at the following address.

RDIFramework.NET official website: www.rdiframework.net/

RDIFramework.NET official blog: blog.rdiframework.net/

Special note, the framework related technical articles please refer to the official website prevail, welcome everyone to collect!

RDIFramework.NET is built by the professional team of Hainan Guosi Software Technology Co., LTD., which has been updated for a long time. Please feel free to use it!

Please follow the official wechat account of RDIFramework.NET (wechat id: Guosisoft) to keep abreast of the latest developments.

Use wechat to scan the QR code for immediate attention