Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
sudo apt-get update
sudo apt-get install mysql-server

Centos 7

Let's update our CentOS 7 install first

Code Block
sudo yum update

Now, we can install mariadb

Code Block
sudo yum install mariadb-server

Securing MariaDB / MySQL after install

You are strongly encouraged to run the following which will interactively run you through implementing a basic secure configuration for MariaDB / MySQL:

...

The -p flag signifies login with a password (the password that you set in the previous step when you executed sudo mysql_secure_installation.

To create a new user and a standard type database, we're going to run the following after logging into MySQL

Code Block
languagesql
CREATE USER '<dbuser>'@'localhost' IDENTIFIED BY '<PASSWORD>';
CREATE DATABASE <dbname> CHARACTER SET utf8 COLLATE utf8_bin;
GRANT ALL PRIVILEGES ON <dbname>.* TO '<dbuser>'@'localhost' IDENTIFIED BY '<PASSWORD>';
FLUSH PRIVILEGES;

...