MariaDB l? g?? H??ng d?n c?i ??t MariaDB tr?n Ubuntu Linux

MariaDB l? g?? H??ng d?n c?i ??t MariaDB tr?n Ubuntu Linux

MariaDB là gì?

MariaDB là m?t h? th?ng qu?n lý c? s? d? li?u mã ngu?n m? (DBMS) ph? bi?n ???c phát tri?n b?i MariaDB Corporation Ab, ???c thành l?p b?i các nhà phát tri?n chính t? d? án MySQL. MariaDB có th? t??ng thích ng??c v?i MySQL, ?i?u này có ngh?a là các ?ng d?ng và công c? ???c phát tri?n cho MySQL th??ng có th? ch?y trên MariaDB mà không c?n s?a ??i nhi?u. MariaDB ???c coi là m?t s? thay th? mã ngu?n m? và có hi?u su?t cao cho MySQL. Nó cung c?p m?t s? tính n?ng m?i và c?i thi?n so v?i MySQL, c?ng nh? h? tr? cho các tính n?ng m?i trong chu?n SQL. MariaDB là m?t ph?n c?a nhi?u b?n phân ph?i Linux ph? bi?n và là m?t l?a ch?n ph? bi?n cho vi?c tri?n khai c? s? d? li?u trong các ?ng d?ng web, app, games.

H??ng d?n cài ??t MariaDB trên Ubuntu Linux

update APT repositories

sudo apt update

Cài ??t MariaDB:

sudo apt install mariadb-server

v?y là cài ??t xong r?i ?ó, r?t ??n gi?n ph?i không nào, ?? ki?m tra xem em nó ?ã ch?y ch?a thì:

sudo systemctl status mariadb
? mariadb.service - MariaDB 10.3.39 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2024-03-18 10:15:58 CET; 10min ago
       Docs: man:mysqld(8)
             https://mariadb.com/kb/en/library/systemd/
   Main PID: 82734 (mysqld)
     Status: "Taking your SQL requests now..."
      Tasks: 31 (limit: 7042)
     Memory: 63.0M
     CGroup: /system.slice/mariadb.service
             ??82734 /usr/sbin/mysqld

ra k?t qu? nh? bên trên ngh?a là m?i th? ?ã ?n

Thi?t l?p ban ??u cho MariaDB

Ch?y script config:

sudo mysql_secure_installation
hoang@vmi1663369:~# sudo mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

You already have a root password set, so you can safely answer 'n'.

Change the root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

b?n nh?p theo bên trên là ???c, ??i lo?i là s? ??t password cho root và m?t s? tùy ch?n thì c? nh?p y là ok

T?o user khác v?i quy?n admin ?? ti?n dùng thay cho user root

ch?y l?nh sau ?? vào qu?n lý MariaDB:

sudo mariadb

T?o user v?i quy?n root, nh? thay username và password:

GRANT ALL ON *.* TO 'yourusername'@'localhost' IDENTIFIED BY 'yourpassword' WITH GRANT OPTION;
FLUSH PRIVILEGES;
exit

L?i k?t

V?y là xong, bài vi?t này ?ã h??ng d?n ??y ?? t? cài ??t MariaDB trên Ubuntu Linux cho t?i thi?t l?p ban ??u và t?o user v?i quy?n root ?? s? d?ng cho project c?a b?n

5 2 đánh giá
Đánh giá bài viết
Theo dõi
Thông báo của
guest

0 Góp ý
Phản hồi nội tuyến
Xem tất cả bình luận