CentOS7 installing the MySQL Database

Source: Internet
Author: User

Installation Environment:

[Email protected] rookie]# lsb_release-a

LSB Version:: Core-4.1-amd64:core-4.1-noarch

Distributor Id:centos

Description:centos Linux release 7.4.1708 (Core)

release:7.4.1708

Codename:core

Installing the MySQL database

#yum Install Mysql-server

#yum Install Mysql-devel

#yum install MySQL

The following error occurred while installing mysql-server :

[email protected] rookie]# Yum install Mysql-server

Loaded Plugins:fastestmirror

Loading mirror speeds from cached hostfile

* base:mirrors.tuna.tsinghua.edu.cn

* Extras:mirrors.btte.net

* Updates:mirrors.btte.net

No Package Mysql-server Available

The information found is The CentOS7 version removes the MySQL database software from the default program list and replaces it with MARIADB .

Workaround: 1, completely uninstall MARIADB

Uninstall MARIADB Database

query for the installed MARIADB components:

[Email protected] rookie]# Rpm-qa | grep maria*
Mariadb-server-5.5.49-1.el7.centos.x86_64
Mariadb-common-5.5.49-1.el7.centos.x86_64
Mariadb-client-5.5.49-1.el7.centos.x86_64

To unload a database:

[Email protected] rookie]# yum-y Remove mari*

To delete a database file:

[Email protected] rookie]# rm-rf/var/lib/mysql/*

2. official website Download install mysql-server

Download First:

# 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

3. Restart the MYSQLD service after installation is complete.

# Service Mysqld Restart

PS: Initial installation mysql,root Account no password

4. Configure MySQL

MySQL config file is/etc/my.cnf

Encoding Method

Finally add the encoding configuration

[MySQL]

Default-character-set=utf8

the character encoding here must be consistent with the /usr/share/mysql/charsets/index.xml.

Set Password

Assign all the permissions for all tables in all databases to a value in all The root user of the IP address.

Mysql> Grant all privileges on * * to [e-mail protected] '% ' identified by ' abc123! ';

mysql> flush Privileges;

If you are a new user and not root, create a new user first

Mysql>create user ' username ' @ '% ' identified by ' passwd ';

CentOS7 installing the MySQL Database

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.