Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install mysql8.0rpm on centos7

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article is about how to install mysql8.0rpm on centos7. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

The first is to download the illustration

1. First uninstall the mariadb that comes with centos7.

Rpm-qa | grep mariadb / / query the installed mariadbrpm-e-- nodeps file name / / uninstall mariadb, and 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 using the rm-rf mysql file path

Find /-name mysql

Delete distributed mysql files

Find /-name mysql / # whereis mysql

Delete configuration document

Rm-rf / etc/my.cnf

Check again to see if the machine has mysql installed

Rpm-qa | grep-I mysql

3. Install the mysql dependency package (optional)

Yum-y install libaio.so.1 libgcc_s.so.1 libstdc++.so.6yum update libstdc++-4.4.7-4.el6.x86_64yum search libaio # retrieve related information yum install libaio # install dependency package yum install net-tools

4. Decompress MySQL-5.6.40-1.el7.x86_64.rpm-bundle.tar to the mysql directory under / usr/local/ (manual creation of mysql directory, mkdir mysql)

Tar-xvf MySQL-5.6.40-1.el7.x86_64.rpm-bundle.tar-C / usr/local/mysql

5. Install mysql under / usr/local/mysql. Pay attention to the sequence of installation and dependencies.

Rpm-ivh... Common.rpmrpm-ivh... Libs.rpmrpm-ivh... Client.rpmrpm-ivh... Server.rpm

After the installation is completed, the following directory is generated to store mysql-related files

Clip_image002

6. Initialize mysql

Mysqld-initialize-user=mysql

After initialization is completed, there will be a random password at the end of the following file, which will be used when logging in later.

Cat / varUnix logamp mysqld.logclippictures image004CgchanghLde4oLG+

6. Start, stop and restart mysql

Start:

Systemctl start mysqld.service

Start with service: service mysqld start

Start with the mysqld script: / etc/inint.d/mysqld start

Start with safe_mysqld: safe_mysqld&

Stop:

Start with service: service mysqld stop

Start with the mysqld script: / etc/inint.d/mysqld stop

Mysqladmin shutdown

Restart:

Start with service: service mysqld restart

Start with the mysqld script: / etc/inint.d/mysqld restart

8. Log in to mysql

Mysql-u root-pclip_image006

9. Change the password (log in to mysql)

Alter user 'root'@'localhost' identified by' 123456client / clipkeeper image007

Mysql8.0 must be modified using the alert command or the following error will occur:

Clip_image008

10. Enable remote login of mysql

After logging in

Show databases;use mysql;updata user set host='%' where user = 'root';select user,host from user;clip_image009clip_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

Displays the status of a service: systemctl status firewalld.service

Enable a service at boot time: systemctl enable firewalld.service

Disable one service at boot time: systemctl disable firewalld.service

Check to see if the service is powered on: 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

Firewall-cmd-- zone=public-- add-port=80/tcp-- permanent (--permanent takes effect permanently, and becomes invalid after restart without this parameter)

Reload

Firewall-cmd-reload Thank you for your reading! This is the end of this article on "how to install mysql8.0rpm on centos7". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report