Home Database Mysql Tutorial Cloud server Centos7.3 installation mysql5.7.18 rpm installation steps

Cloud server Centos7.3 installation mysql5.7.18 rpm installation steps

Jun 23, 2017 pm 03:04 PM
Install Ali

Uninstall MariaDB

CentOS7 installs MariaDB by default instead of MySQL, and MySQL-related software packages are also removed from the yum server. Because MariaDB and MySQL may conflict, uninstall MariaDB first.

1. Before installing the new version of mysql, we need to uninstall the mariadb-lib that comes with the system

[root@iZwz94qazh62gk5ewl4ei2Z home]# rpm -qa | grep -i mariadb
 mariadb-libs-5.5.52-1.el7.x86_64
[root@iZwz94qazh62gk5ewl4ei2Z home]# rpm -e --nodeps mariadb-libs-5.5.52-1.el7.x86_64
Copy after login

2. Go to the official website of mysql to download the rpm set of the latest version of mysql Package: mysql-5.7.18-1.el6.x86_64.rpm-bundle.tar

3. Upload mysql-5.7.18-1.el6.x86_64.rpm-bundle.tar to the linux server, and Unzip the tar package

[root@iZwz94qazh62gk5ewl4ei2Z home]# mkdir mysql
[root@iZwz94qazh62gk5ewl4ei2Z home]# tar -xf mysql-5.7.18-1.el6.x86_64.rpm-bundle.tar -C mysql
[root@iZwz94qazh62gk5ewl4ei2Z home]# cd mysql
[root@iZwz94qazh62gk5ewl4ei2Z mysql]# ll
total 459492-rw-r--r-- 1 7155 31415  23618836 Mar 20 17:40 mysql-community-client-5.7.18-1.el6.x86_64.rpm-rw-r--r-- 1 7155 31415    335496 Mar 20 17:40 mysql-community-common-5.7.18-1.el6.x86_64.rpm-rw-r--r-- 1 7155 31415   3747352 Mar 20 17:40 mysql-community-devel-5.7.18-1.el6.x86_64.rpm-rw-r--r-- 1 7155 31415  39086508 Mar 20 17:40 mysql-community-embedded-5.7.18-1.el6.x86_64.rpm-rw-r--r-- 1 7155 31415 135869292 Mar 20 17:40 mysql-community-embedded-devel-5.7.18-1.el6.x86_64.rpm-rw-r--r-- 1 7155 31415   2177064 Mar 20 17:40 mysql-community-libs-5.7.18-1.el6.x86_64.rpm-rw-r--r-- 1 7155 31415   1723180 Mar 20 17:40 mysql-community-libs-compat-5.7.18-1.el6.x86_64.rpm-rw-r--r-- 1 7155 31415 159060212 Mar 20 17:41 mysql-community-server-5.7.18-1.el6.x86_64.rpm-rw-r--r-- 1 7155 31415 104881084 Mar 20 17:41 mysql-community-test-5.7.18-1.el6.x86_64.rpm
Copy after login

4. Use the rpm -ivh command to install

[root@iZwz94qazh62gk5ewl4ei2Z mysql]# -community-common-.-.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key /:mysql-community-common-.-.e################################# [-community-libs-.-.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key /:mysql-community-libs-.-.el6################################# [-community-client-.-.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key /:mysql-community-client-.-.e################################# [-community-server-.-.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key /:mysql-community-server-.-.e################################# [
Copy after login

The above packages have dependencies and must be executed in order.

Use the rpm installation method to install mysql. The installation path is as follows:

a Database directory
/var/lib/mysql/
b Configuration file
/usr/share /mysql(mysql.server command and configuration file)
c Related commands
/usr/bin(mysqladmin mysqldump and other commands)
d Startup script
/etc/rc.d/init.d/ (Directory of startup script file mysql)

e /etc/my.conf

5. Database initialization

In order to ensure that the database directory is logged in with the owner of the file being mysql User, if your Linux system is running the mysql service as root, you need to execute the following command to initialize

[root@iZwz94qazh62gk5ewl4ei2Z mysql]# mysqld --initialize --user=mysql
Copy after login

If you are logged in and run as mysql, you can remove the --user option.

In addition, the --initialize option defaults to initialization in "safe" mode, which will generate a password for the root user and mark the password as expired. After logging in, you need to set a new password,

When using the --initialize-insecure command, the safe mode is not used and a password will not be generated for the root user.

The --initialize initialization used in the demonstration here will generate a root account password. The password is in the log file. The red area is the automatically generated password

[root@iZwz94qazh62gk5ewl4ei2Z mysql]# cat /var/log/mysqld.log2017-06-05T14:30:52.709474Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).2017-06-05T14:30:55.590590Z 0 [Warning] InnoDB: New log files created, LSN=457902017-06-05T14:30:56.000269Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.2017-06-05T14:30:56.109868Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 960c533e-49fb-11e7-91f2-00163e089fd2.2017-06-05T14:30:56.116186Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.2017-06-05T14:30:56.116777Z 1 [Note] A temporary password is generated for root@localhost: :Wu?2QQutQwj
Copy after login

Now start the mysql database systemctl start mysqld.service (Centos7-specific startup method)

[root@iZwz94qazh62gk5ewl4ei2Z mysql]# systemctl start mysqld.service
Copy after login

You can use the following two commands to stop, start and restart mysql:

Start:

使用 service 启动:service mysqld start
使用 mysqld 脚本启动:/etc/inint.d/mysqld start
使用 safe_mysqld 启动:safe_mysqld&
Copy after login

Stop:

使用 service 启动:service mysqld stop
使用 mysqld 脚本启动:/etc/inint.d/mysqld stop
mysqladmin shutdown
Copy after login

Restart:

使用 service 启动:service mysqld restart
使用 mysqld 脚本启动:/etc/inint.d/mysqld restart
Copy after login

Connect to database

[root@iZwz94qazh62gk5ewl4ei2Z mysql]# mysql -u root -p 
Enter password:
Copy after login

Password input: :Wu?2QQutQwj

Change password:

set password = password('你的密码');
Copy after login

Set up remote access

grant all privileges on *.* to 'root' @'%' identified by '123456'; 
flush privileges;
Copy after login

Set mysql to start at boot

加入到系统服务:
chkconfig --add mysqld
自动启动:
chkconfig mysqld on
查询列表:
chkconfig

说明:都没关闭(off)时是没有自动启动。
Copy after login

flush privileges;

The above is the detailed content of Cloud server Centos7.3 installation mysql5.7.18 rpm installation steps. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Solution to the problem that Win11 system cannot install Chinese language pack Solution to the problem that Win11 system cannot install Chinese language pack Mar 09, 2024 am 09:48 AM

Solution to the problem that Win11 system cannot install Chinese language pack With the launch of Windows 11 system, many users began to upgrade their operating system to experience new functions and interfaces. However, some users found that they were unable to install the Chinese language pack after upgrading, which troubled their experience. In this article, we will discuss the reasons why Win11 system cannot install the Chinese language pack and provide some solutions to help users solve this problem. Cause Analysis First, let us analyze the inability of Win11 system to

Unable to install guest additions in VirtualBox Unable to install guest additions in VirtualBox Mar 10, 2024 am 09:34 AM

You may not be able to install guest additions to a virtual machine in OracleVirtualBox. When we click on Devices>InstallGuestAdditionsCDImage, it just throws an error as shown below: VirtualBox - Error: Unable to insert virtual disc C: Programming FilesOracleVirtualBoxVBoxGuestAdditions.iso into ubuntu machine In this post we will understand what happens when you What to do when you can't install guest additions in VirtualBox. Unable to install guest additions in VirtualBox If you can't install it in Virtua

Alibaba Cloud announced that the 2024 Yunqi Conference will be held in Hangzhou from September 19th to 21st. Free application for free tickets Alibaba Cloud announced that the 2024 Yunqi Conference will be held in Hangzhou from September 19th to 21st. Free application for free tickets Aug 07, 2024 pm 07:12 PM

According to news from this website on August 5, Alibaba Cloud announced that the 2024 Yunqi Conference will be held in Yunqi Town, Hangzhou from September 19th to 21st. There will be a three-day main forum, 400 sub-forums and parallel topics, as well as nearly four Ten thousand square meters of exhibition area. Yunqi Conference is free and open to the public. From now on, the public can apply for free tickets through the official website of Yunqi Conference. An all-pass ticket of 5,000 yuan can be purchased. The ticket website is attached on this website: https://yunqi.aliyun.com/2024 /ticket-list According to reports, the Yunqi Conference originated in 2009 and was originally named the First China Website Development Forum. In 2011, it evolved into the Alibaba Cloud Developer Conference. In 2015, it was officially renamed the "Yunqi Conference" and has continued to successful move

What should I do if Baidu Netdisk is downloaded successfully but cannot be installed? What should I do if Baidu Netdisk is downloaded successfully but cannot be installed? Mar 13, 2024 pm 10:22 PM

If you have successfully downloaded the installation file of Baidu Netdisk, but cannot install it normally, it may be that there is an error in the integrity of the software file or there is a problem with the residual files and registry entries. Let this site take care of it for users. Let’s introduce the analysis of the problem that Baidu Netdisk is successfully downloaded but cannot be installed. Analysis of the problem that Baidu Netdisk downloaded successfully but could not be installed 1. Check the integrity of the installation file: Make sure that the downloaded installation file is complete and not damaged. You can download it again, or try to download the installation file from another trusted source. 2. Turn off anti-virus software and firewall: Some anti-virus software or firewall programs may prevent the installation program from running properly. Try disabling or exiting the anti-virus software and firewall, then re-run the installation

How to install Android apps on Linux? How to install Android apps on Linux? Mar 19, 2024 am 11:15 AM

Installing Android applications on Linux has always been a concern for many users. Especially for Linux users who like to use Android applications, it is very important to master how to install Android applications on Linux systems. Although running Android applications directly on Linux is not as simple as on the Android platform, by using emulators or third-party tools, we can still happily enjoy Android applications on Linux. The following will introduce how to install Android applications on Linux systems.

How to install Podman on Ubuntu 24.04 How to install Podman on Ubuntu 24.04 Mar 22, 2024 am 11:26 AM

If you have used Docker, you must understand daemons, containers, and their functions. A daemon is a service that runs in the background when a container is already in use in any system. Podman is a free management tool for managing and creating containers without relying on any daemon such as Docker. Therefore, it has advantages in managing containers without the need for long-term backend services. Additionally, Podman does not require root-level permissions to be used. This guide discusses in detail how to install Podman on Ubuntu24. To update the system, we first need to update the system and open the Terminal shell of Ubuntu24. During both installation and upgrade processes, we need to use the command line. a simple

How to Install and Run the Ubuntu Notes App on Ubuntu 24.04 How to Install and Run the Ubuntu Notes App on Ubuntu 24.04 Mar 22, 2024 pm 04:40 PM

While studying in high school, some students take very clear and accurate notes, taking more notes than others in the same class. For some, note-taking is a hobby, while for others, it is a necessity when they easily forget small information about anything important. Microsoft's NTFS application is particularly useful for students who wish to save important notes beyond regular lectures. In this article, we will describe the installation of Ubuntu applications on Ubuntu24. Updating the Ubuntu System Before installing the Ubuntu installer, on Ubuntu24 we need to ensure that the newly configured system has been updated. We can use the most famous "a" in Ubuntu system

Detailed steps to install Go language on Win7 computer Detailed steps to install Go language on Win7 computer Mar 27, 2024 pm 02:00 PM

Detailed steps to install Go language on Win7 computer Go (also known as Golang) is an open source programming language developed by Google. It is simple, efficient and has excellent concurrency performance. It is suitable for the development of cloud services, network applications and back-end systems. . Installing the Go language on a Win7 computer allows you to quickly get started with the language and start writing Go programs. The following will introduce in detail the steps to install the Go language on a Win7 computer, and attach specific code examples. Step 1: Download the Go language installation package and visit the Go official website

See all articles