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
/****************** * Advanced character device d...
Hyperlink, also called "link". Hyperlin...
The HTML specification document introduces the cr...
Table of contents 1. Class 1.1 constructor() 1.2 ...
Recently, I need to stress test the server again....
Uninstall the installed version on Ubuntu: sudo a...
Preface Tomcat is an excellent Java container, bu...
1. Create a new rabbitmq in the /etc/init.d direc...
If every company wants to increase its user base,...
We know that the commonly used events in JS are: ...
What I bring to you today is to use jQuery to imp...
1. When the width of the adjacent floating layer o...
Table of contents 1. Query Optimization 1. MySQL ...
The data type of MySQL is datetime. The data stor...
1. Flex layout .father { display: flex; justify-c...