top of page

HƯỚNG DẪN CÀI MARIADB TRÊN CENTOS 7

Writer's picture: Tuan NguyenTuan Nguyen

Chúng ta sẽ cài Mariadb bản mới nhất dựa vào Repositories chính thức của Mariadb.


1. Tạo file repo tên là MariaDB.repo


# vi /etc/yum.repos.d/MariaDB.repo

Nội dung file:

# MariaDB 10.3 CentOS repository list - created 2018-05-25 19:02 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.3/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

Nếu muốn cài version khác của MariaDB thì tham khảo trang repositories MariaDB

Cập nhật thông tin về Repository MariaDB 10.3 mới cấu hình ở file MariaDB.repo

# yum repolist

2. Cài MariaDB với lệnh yum

# yum install MariaDB-server MariaDB-client -y

3. Khởi động dịch vụ MariaDB

# systemctl start mariadb
# systemctl enable mariadb

4. Kiểm tra status MariaDB

# systemctl status mariadb

Kiểm tra version MariaDB

# mysql -V

5. Cấu hình bảo mật MariaDB

Mục đích: đặt mật khẩu cho user root (trong MariaDB chứ không phải user root của hệ thống nhé), xóa anonymous user, hạn chế user root truy cập, xóa database "test"

# mysql_secure_installation

Để kết nối đến MariaDB bằng command line ta dùng lệnh:

# mysql -u root -p
8 views0 comments

Comments


 

© 2018 by Tuấn Nguyễn

 Liên hệ tôi
  • Facebook - Black Circle
  • Google+ - Black Circle
bottom of page