MARIADB Configuration under CentOS

Source: Internet
Author: User

Long-standing space environment configuration forget almost, today Hollow finishing, reset the disk to rebuild the environment, first installed in CentOS 7.0 MARIADB database, here to record the installation process for later review.

1, installation mariadb

Installation commands

Install MARIADB Mariadb-server

Installation Complete mariadb, first start mariadb

Systemctl Start mariadb

Set boot up

Systemctl Enable MARIADB

The following is a simple configuration of mariadb

Mysql_secure_installation

The first is to set the password, you will be prompted to enter the password

Enter current password to root (enter for none): <– First run direct carriage return

Set Password

Set root Password? [y/n] <– whether to set the root user password, enter Y and return or direct enter
New Password: <– Set the root user's password
Re-enter new password: <– Enter the password you set again

Other configurations

Remove anonymous users? [y/n] <– Whether to delete anonymous users, enter

Disallow Root login remotely? [y/n] <– Whether root login is forbidden, enter,

Remove test database and access to it? [y/n] <– Whether to delete the test database, enter

Reload privilege tables now? [y/n] <– whether to reload the permissions table, enter

Initialize MARIADB complete, next Test login

Mysql-uroot-ppassword

Complete.

2. Configuring the MARIADB Character Set

File/etc/my.cnf

Vi/etc/my.cnf

Add under the [Mysqld] tab

init_connect='set collation_connection = Utf8_unicode_ci' init_connect='set NAMES UTF8' character-set-server=UTF8 collation-server=utf8_unicode_ci skip-character-set-client-handshake 

File/etc/my.cnf.d/client.cnf

Vi/etc/my.cnf.d/client.cnf

Add in [client]

Default-character-set=utf8

File/etc/my.cnf.d/mysql-clients.cnf

Vi/etc/my.cnf.d/mysql-clients.cnf

Add in [MySQL]

Default-character-set=utf8

Complete configuration, restart MARIADB

Systemctl Restart MARIADB

Then enter MARIADB to view the character set

Like "%character like"%collation% ";    

Displayed as


+--------------------------+----------------------------+
| variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | UTF8 |
| character_set_connection | UTF8 |
| Character_set_database | UTF8 |
| Character_set_filesystem | binary |
| Character_set_results | UTF8 |
| Character_set_server | UTF8 |
| Character_set_system | UTF8 |
| Character_sets_dir | /usr/share/mysql/charsets/|
+--------------------------+----------------------------+
8 rows in Set (0.00 sec)

+----------------------+-----------------+
| variable_name | Value |
+----------------------+-----------------+
| collation_connection | Utf8_unicode_ci |
| Collation_database | Utf8_unicode_ci |
| Collation_server | Utf8_unicode_ci |
+----------------------+-----------------+
3 Rows in Set (0.00 sec)

The character set configuration is complete.

3. Add users, set permissions

Create user command

MySQL>user username'password';

Direct creation of user and authorized commands

MySQL>*.  To username'password';     

Grant access to the extranet

MySQL>*.  to [email protected]'%'password';       

Grant permissions and can authorize

MySQL>*.  to [email protected]' hostname'passwordoption;      

Simple user and permission configuration is basically the case.

Where only partial permissions are granted to change all privileges or all to Select,insert,update,delete,create,drop,index,alter,grant,references,reload, Shutdown,process,file part of it.

MARIADB Configuration under CentOS

Related Article

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.