Difference between revisions of "Configuring basic MariaDB server"
m |
m |
||
(7 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
[[Main Page|Home]] > [[CentOS]] > [[CentOS 6.x]] > [[Mariadb configuration|MariaDB configuration]] > [[Configuring basic MariaDB server]] | |||
=Installation= | =Installation= | ||
To install | To install mariadb server use: | ||
<pre> | <pre> | ||
yum -y install | yum -y install mariadb-server | ||
</pre> | </pre> | ||
Line 16: | Line 16: | ||
To start mysql server use: | To start mysql server use: | ||
<pre> | <pre> | ||
systemctl start mariadb | |||
</pre> | </pre> | ||
Line 24: | Line 24: | ||
To configure mysql server such that it automatically runs on system boot use: | To configure mysql server such that it automatically runs on system boot use: | ||
<pre> | <pre> | ||
systemctl enable mariadb | |||
</pre> | </pre> | ||
Line 33: | Line 33: | ||
==Configuring application specific username, password and database== | |||
Many different applications can use MySQL database in parallel. In order to ensure isolation among such applications a different MySQL database with separate set of user credentials can be created for each application. To create a application specific MySQL database, corresponding user and password use: | |||
#Login into mysql as root using '<tt>mysql -u root -p</tt>' | |||
#Create database using '<tt>create database <database-name>;</tt>' | |||
#Create user with permissions and passwords using | |||
#:<pre> | |||
#::grant all on <database-name>.* to <username>@localhost identified by '<password>'; | |||
#:</pre> | |||
#Reload privilege table using '<tt>flush privileges;</tt>' | |||
[[Main Page|Home]] > [[CentOS]] > [[CentOS 6.x]] > [[Mariadb configuration|MariaDB configuration]] > [[Configuring basic MariaDB server]] |
Latest revision as of 02:49, 5 March 2022
Home > CentOS > CentOS 6.x > MariaDB configuration > Configuring basic MariaDB server
Installation
To install mariadb server use:
yum -y install mariadb-server
Configuration
Starting mysql server
To start mysql server use:
systemctl start mariadb
Enabling on start-up
To configure mysql server such that it automatically runs on system boot use:
systemctl enable mariadb
Setting root password
By defauly mysql root user has no password (empty password) which is not very secure. To setup root password for mysql use '/usr/bin/mysql_secure_installation' script. This script will ask for current root password which is blank and then will ask for new root password twice. It will also ask a number of other queries. Answer 'Y' (default) for all other queries.
Configuring application specific username, password and database
Many different applications can use MySQL database in parallel. In order to ensure isolation among such applications a different MySQL database with separate set of user credentials can be created for each application. To create a application specific MySQL database, corresponding user and password use:
- Login into mysql as root using 'mysql -u root -p'
- Create database using 'create database <database-name>;'
- Create user with permissions and passwords using
- grant all on <database-name>.* to <username>@localhost identified by '<password>';
- Reload privilege table using 'flush privileges;'
Home > CentOS > CentOS 6.x > MariaDB configuration > Configuring basic MariaDB server