MARIADB the various settings after installation

Source: Internet
Author: User
1, start mariadb

Install complete mariadb, start mariadb First, two commands can be

Systemctl Start mariadb

Or

Service MARIADB Start

Setting up Boot

Systemctl Enable MARIADB

Or:

Chkconfig mariadb on
2, the next MARIADB related to the simple configuration
Mysql_secure_installation

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

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

Set Password

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

Other configuration

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

Disallow root login remotely? [y/n] <– whether to prevent root remote logins, carriage returns,

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 permission table, enter

Initialize MARIADB complete, next Test login

mysql-uroot-p [Enter the password after entering]

Complete. 3, configure the MARIADB character set

To set up the client:

VIM/ETC/MY.CNF.D/MYSQL-CLIENTS.CNF

[MySQL]
Default-character-set=utf8

Set up the service side:

VIM/ETC/MY.CNF.D/SERVER.CNF

[mysqld]
init_connect= ' SET collation_connection = Utf8_general_ci '
init_ connect= ' SET NAMES UTF8 '
character-set-server=utf8
collation-server=utf8_general_ci
Skip-character-set-client-handshake

#开启慢查询
slow_query_log = on
slow_query_log_file =/usr/local/ Mysql/data/slow.log
long_query_time = 1

Full configuration complete, reboot MARIADB

Systemctl Restart MARIADB

Then enter MARIADB View character set

Mysql> Show variables like "%character%", show variables like "%collation%";

Displayed as

MARIADB [(None)]> show variables like "%character%", show variables like "%collation%"; +--------------------------+----------------------------+
| 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_general_ci | | Collation_datAbase | Utf8_general_ci | | Collation_server |
Utf8_general_ci |
 +----------------------+-----------------+ 3 rows in Set (0.00 sec)

The character set configuration is complete. 4, add users, set permissions

Create a user command

Mysql>create user username@localhost identified by ' password ';

Create a user and authorize a command directly

Mysql>grant all on *.* to Username@localhost indentified by ' password ';

Grant the right to the extranet, but not two level authorization;

Mysql>grant all privileges in *.* to username@ '% ' identified by ' password ';

Grant permissions and can be authorized two times

Mysql>grant all privileges in *.* to username@ ' hostname ' identified by ' password ' with GRANT option;

Simple user and privilege configuration is basically the case.
Only partial permissions are granted to the all privileges or all of them to:
Select,insert,update,delete,create,drop,index,alter,grant,references,reload,shutdown,process,file
Part of it.

Linux System Tutorial: How to check the MARIADB server-side version http://www.linuxidc.com/Linux/2015-08/122382.htm

Realization of MARIADB Proxy read-write separation http://www.linuxidc.com/Linux/2014-05/101306.htm

How to compile and install the MARIADB database under Linux http://www.linuxidc.com/Linux/2014-11/109049.htm

The CentOS system uses Yum to install the MARIADB database http://www.linuxidc.com/Linux/2014-11/109048.htm

Install mariadb and MySQL coexist http://www.linuxidc.com/Linux/2014-11/109047.htm

How to migrate MySQL 5.5 database to mariadb http://www.linuxidc.com/Linux/2014-11/109471.htm on Ubuntu

Translation Ubuntu 14.04 (trusty) Server installation mariadb http://www.linuxidc.com/Linux/2014-12/110048htm

Mariadb Detailed Introduction: http://www.linuxidc.com/Linux/2012-03/56857.htm

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.