CENTOS7 Self-study 4-MARIADB database installation. MD

Source: Internet
Author: User
Tags character set centos create database
a) All delete the system comes with the mysql/mariadb

MySQL is no longer included in the CentOS 7 source, but instead MariaDB; Using Rpm-qa | grep MariaDB searches for MariaDB existing packages. Using Rpm-qa | grep MySQL Search
MySQL Existing package: If present, use Rpm-e–nodeps mariadb-,rpm-e–nodeps mysql all delete: use Rpm-qa | grep Mariadb,rpm-qa | grep MySQL Search Mariadb,mysql again
Existing packages: If present, use Yum remove mysql-* | Yum Remove mariadb-* all delete; use yum List installed | grep MySQL or yum list installed | grep mariadb
If present, use Yum remove mysql-* | Yum Remove mariadb-* all delete; II) Add mariadb yum Source to create/etc/yum.repos.d/mariadb.repo:
VI +/ETC/YUM.REPOS.D/MARIADB.REPO Add the yum source, which is added as shown in the figure:

# MariaDB 10.1 CentOS repository list-created 2016-03-03 13:06 UTC
#http://mariadb.org/mariadb/repositories/
[ MARIADB]
name = mariadb
BaseURL = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https:// YUM.MARIADB.ORG/RPM-GPG-KEY-MARIADB
gpgcheck=1

——————————————— Download Address
https://downloads.mariadb.org/mariadb/repositories/#mirror =opencas&distro=centos&distro_release= centos7-amd64–centos7&version=10.1 three) installation MariaDB

Run the Yum install mariadb-server mariadb-client command installation MariaDB
or sudo yum install mariadb-server mariadb-client IV) Start, configure MariaDB start the MariaDB service using the service MySQL start command and then run mysql_s Ecure_installation Configuration mariadb:
Configuration options: y n n N y five) log in to MariaDB and create the appropriate database user and database using mysql-u root-p login, enter the password after entering. Note that the password is not echoed; Create a new user, creating the "user ' paac ' @ ' localhost ' identified by
' Password '; Where password fill in the password you set. Of course, can be modified later; VI) Use the new user to connect to the database execution mysql-u paac-p Enter the password, fill in the password to create the user settings before you can log in to execute the corresponding command, set up the storage engine, create a database, set user rights;
Create a database

create DATABASE paac DEFAULT CHARACTER SET utf8; user paac; CREATE table user (id int (11 ) primary key, username varchar (n) not NULL, password varchar (+) NOT null) default CharSet = UTF8; 

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.