1. System environment [root@localhost home]# cat /etc/redhat-release CentOS Linux release 7.2.1511 (Core) 2. MySQL installation The installation of mysql and mysql-devel was successful, but the installation of mysql-server failed, as follows: [root@localhost home]# yum install mysql-server Loaded plugins: fastestmirror, langpacks Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast base | 3.6 kB 00:00:00 extras | 3.4 kB 00:00:00 updates | 3.4 kB 00:00:00 (1/4): base/7/x86_64/group_gz | 155 kB 00:00:01 (2/4): extras/7/x86_64/primary_db | 139 kB 00:00:01 (3/4): base/7/x86_64/primary_db | 5.6 MB 00:00:38 (4/4): updates/7/x86_64/primary_db | 4.7 MB 00:00:39 Loading mirror speeds from cached hostfile * base: mirrors.163.com * extras: mirrors.163.com * updates: mirrors.163.com No package mysql-server available. Error: No action required This problem occurs because the CentOS 7 version removes the MySQL database software from the default program list and replaces it with mariadb There are two solutions: Method 1 : Install mariadb MariaDB database management system is a branch of MySQL. It adopts GPL license. The purpose of MariaDB is to be fully compatible with MySQL, including API and command line, so that it can easily become a substitute for MySQL. MariaDB was developed by Michael Widenius, the founder of MySQL. He had previously sold his company MySQL AB to SUN. After that, with SUN being acquired by Oracle, the ownership of MySQL also fell into the hands of Oracle. MariaDB is named after Michael Widenius' daughter Maria. Install mariadb, enter the installation command [root@localhost home]# yum install mariadb-server mariadb The relevant commands for the mariadb database are: systemctl start mariadb #Start MariaDB systemctl stop mariadb #Stop MariaDB systemctl restart mariadb #Restart MariaDB systemctl enable mariadb #Set boot startup Start the database first [root@yl-web yl]# systemctl start mariadb No password by default [root@localhost lzh]# mysql -u root -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 6 Server version: 5.5.52-MariaDB MariaDB Server Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> show databases; +--------------------+ | Database | +--------------------+ | information_schema | |mysql | | performance_schema | | test | +--------------------+ 4 rows in set (0.01 sec) Method 2: Download and install mysql-server from the official website # wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm # rpm -ivh mysql-community-release-el7-5.noarch.rpm # yum install mysql-community-server After successful installation, restart the mysql service # service mysqld restart When installing MySQL for the first time, the root account has no password [root@localhost lzh]# mysql -u root Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.6.26 MySQL Community Server (GPL) Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | |mysql | | performance_schema | | test | +--------------------+ 4 rows in set (0.01 sec) Set password mysql> set password for 'root'@'localhost' =password('password'); Query OK, 0 rows affected (0.00 sec) After installation, mariadb is automatically replaced and will no longer take effect. [root@localhost lzh]# rpm -qa |grep mariadb Wonderful topic sharing: Installation tutorials for different versions of MySQL Installation tutorials for MySQL 5.7 versions Installation tutorials for MySQL 5.6 versions The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Linux method example to view all information of the process
>>: In-depth explanation of closure in JavaScript
Preface The reason why MySQL's innodb engine ...
The first method: Use Junge's one-click scrip...
This article example shares the specific code of ...
Preface In the process of developing a mini progr...
A website uses a lot of HTML5 and CSS3, hoping th...
1. Record several methods of centering the box: 1...
Table of contents 1. Global beforeEach 1. Global ...
summary Project description format <img src=&q...
In order to avoid repeatedly entering the Docker ...
This article shares with you how to query the sta...
Server Status Analysis View Linux server CPU deta...
1: nginx server solution, modify the .conf config...
CentOS 8 changed the software package installatio...
Ubuntu does not allow root login by default, so t...
Use CSS3 to animate the input box similar to the ...