First, download the diagram 1. First uninstall the mariadb that comes with centos7 rpm -qa|grep mariadb //Query the installed mariadb rpm -e --nodeps file name //Uninstall mariadb, the file name is the file queried by the above command 2. Check whether mysql has been installed rpm -qa | grep -i mysql Find the mysql file and delete it using rm -rf mysql file path find / -name mysql Delete scattered mysql files find / -name mysql / # whereis mysql Deleting a Configuration Document rm -rf /etc/my.cnf Check again whether mysql is installed on the machine rpm -qa|grep -i mysql 3. Install MySQL dependency package (optional) yum -y install libaio.so.1 libgcc_s.so.1 libstdc++.so.6 yum update libstdc++-4.4.7-4.el6.x86_64 yum search libaio # Retrieve relevant information yum install libaio # Install dependent packages yum install net-tools 4. Unzip MySQL-5.6.40-1.el7.x86_64.rpm-bundle.tar to the mysql directory under /usr/local/ (create the mysql directory manually, mkdir mysql) tar -xvf MySQL-5.6.40-1.el7.x86_64.rpm-bundle.tar -C /usr/local/mysql 5. Install mysql in /usr/local/mysql. Note that the installation has a sequence and dependencies. rpm -ivh …common.rpm rpm -ivh …libs.rpm rpm -ivh …client.rpm rpm -ivh …server.rpm After the installation is complete, the following directory will be generated to store MySQL related files clip_image002 6. Initialize mysql mysqld --initialize --user=mysql After initialization is complete, there will be a random password at the end of the file below. You will use it when you log in later. cat /var/log/mysqld.log clip_image004 Cg!hLde4oLG+ 6. Start, stop, and restart MySQL start up: systemctl start mysqld.service Start using service: service mysqld start Start using the mysqld script: /etc/inint.d/mysqld start Start using safe_mysqld: safe_mysqld& stop: Start using service: service mysqld stop Start using the mysqld script: /etc/inint.d/mysqld stop mysqladmin shutdown Restart: Start using service: service mysqld restart Start using the mysqld script: /etc/inint.d/mysqld restart 8. Log in to MySQL mysql -u root -p clip_image006 9. Change password (log in to mysql) alter user 'root'@'localhost' identified by '123456'; clip_image007 In mysql8.0, the alert command must be used to modify it, otherwise the following error will occur: clip_image008 10. Enable remote login to mysql After login show databases; use mysql; updata user set host='%' where user = 'root'; select user,host from user; clip_image009 clip_image010 11. Firewall Operation Start a service: systemctl start firewalld.service Shut down a service: systemctl stop firewalld.service Restart a service: systemctl restart firewalld.service Display the status of a service: systemctl status firewalld.service Enable a service at boot: systemctl enable firewalld.service Disable a service at boot: systemctl disable firewalld.service Check whether the service is started: systemctl is-enabled firewalld.service View the list of started services: systemctl list-unit-files | grep enabled View the list of services that failed to start: systemctl --failed 12. Port Operation Add to firewall-cmd --zone=public --add-port=80/tcp --permanent (--permanent takes effect permanently, and will become invalid after restart without this parameter) Reload firewall-cmd –reload Summarize The above is the installation tutorial of mysql8.0rpm on centos7 introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: Detailed explanation of Tomcat configuration and optimization solutions
>>: Detailed explanation of asynchronous iterators in nodejs
Table of contents What is a partition table Parti...
Overview When a 500 or 502 error occurs during ac...
When learning kubernetes, we need to practice in ...
Today, after the game was restarted, I found that...
vue-infinite-scroll Install npm install vue-infin...
Dockerfile is a text file that contains instructi...
1. The first method is to use the unhup command d...
Install ssh tool 1. Open the terminal and type th...
The process of installing MySQL database and conf...
routing vue-router4 keeps most of the API unchang...
I have been studying the source code of Vue recen...
Table of contents need Get data and submit Templa...
1. What are the templates for ASP.NET Web applicat...
Scenario: The interaction methods between parent ...
Table of contents Preface 1. With vue-cli 1. Defi...