GNU/Linux >> Linux の 問題 >  >> Panels >> Panels

Ubuntu16.04にMariaDBをインストールする方法

Ubuntu16.04にMariaDBをインストールする方法を紹介します。 MariaDBは、コミュニティで開発されたMySQLのフォークです。これは、無料でオープンソースの、非常に高速で安定したスケーラブルなデータベースサーバーであり、世界で最も使用されているデータベースサーバーの1つです。これは、人気のあるMySQLデータベースサーバーの改良されたドロップイン代替品です。このチュートリアルでは、Ubuntu16.04にMariaDBをインストールする方法を紹介します。 Ubuntu 16.04へのMariaDBのインストールは簡単な作業です。このチュートリアルの手順に注意深く従えば、MariaDBをUbuntu16.04サーバーに10分以内にインストールする必要があります。始めましょう。

1。サーバーに接続する

まず、SSH経由でユーザーrootとしてサーバーにログインする必要があります:

ssh root@IP_ADDRESS -p PORT_NUMBER

「IP_ADDRESS」と「PORT_NUMBER」を実際のサーバーのIPアドレスとSSHポート番号に置き換えます。

2。システムを更新する

始める前に、次のコマンドを実行して、システムが最新であることを確認しましょう。

apt-get update
apt-get upgrade

3。 Ubuntu16.04へのMariaDBのインストール

MariaDBサーバーのインストールを開始する前に、公式のMariaDBリポジトリを追加する必要があります。

まず、software-properties-commonをインストールします 次のコマンドを使用してサーバーにパッケージ化します。

apt-get install software-properties-common

次に、次のコマンドを実行して、MariaDBGnuPG署名キーをシステムにインポートします。

apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8

そして最後に、MariaDBリポジトリを次のように追加します:

add-apt-repository 'deb [arch=amd64,arm64,i386,ppc64el] http://mirror.nodesdirect.com/mariadb/repo/10.3/ubuntu xenial main'

新しく追加されたリポジトリからMariaDBのインストールを開始できるようにするには、パッケージリストを次のように更新する必要があります。

apt-get update

これで、次のコマンドを使用してサーバーにMariaDBをインストールできます。

apt-get install mariadb-server

インストールが完了すると、MariaDBサービスが自動的に開始されます。システムでサービスが実行されているかどうかを確認するには、次のコマンドを実行できます。

systemctl status mariadb

画面に次の出力が表示されます。

● mariadb.service - MariaDB 10.3.10 database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/mariadb.service.d
└─migrated-from-my.cnf-settings.conf
Active: active (running) since Sat 2018-10-27 13:37:11 CDT; 1h 3min ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Main PID: 15152 (mysqld)
Status: "Taking your SQL requests now..."
CGroup: /system.slice/mariadb.service
└─15152 /usr/sbin/mysqld

そして、MariaDBのバージョンを確認するには、次のように入力します。

mysql  -V
mysql  Ver 15.1 Distrib 10.3.10-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

4。 Ubuntu16.04でのMariaDBインストールの保護

インストールが完了したら、mysql_secure_installationを実行して、MariaDBサーバーのセキュリティを向上させることができます。 次のコマンドを使用してスクリプトを作成します:

mysql_secure_installation

MariaDBrootユーザーの現在のパスワードを入力するように求められます。インストール中にパスワードを設定しなかった場合は、パスワードを空白のままにして、Enterキーを押すことができます:

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):

その後、rootパスワードを変更するか、そのままにするかを選択できます。

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]

この後、さらにいくつかの質問が表示されます。それらすべてに「はい」と答えることをお勧めします。

Remove anonymous users? [Y/n]

Disallow root login remotely? [Y/n]

Remove test database and access to it? [Y/n]

Reload privilege tables now? [Y/n]

すべての手順を完了すると、次の出力が画面に表示されます。

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

Thanks for using MariaDB!

5。 MariaDBに接続する

これで、MariaDBのインストールと保護が完了したら、次のコマンドを入力してMariaDBサーバーに接続できます。

mysql -u root -p

インストール中またはmysql_secure_installation中に設定されたMariaDBルートパスワードの入力を求められます スクリプト。

これにより、MariaDBシェルへのアクセスが許可されます:

Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 21
Server version: 10.3.10-MariaDB-1:10.3.10+maria~xenial-log mariadb.org binary distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>

これで、この手順が完了すると、Ubuntu16.04へのMariaDBのインストールが完了しました。

もちろん、Ubuntu16.04にMariaDBをインストールする必要はありません 、MariaDBホスティングサービスのいずれかを使用している場合は、専門のLinux管理者に、Ubuntu16.04サーバーにMariaDBをインストールして構成するよう依頼するだけです。 24×7でご利用いただけます インストールと構成はすぐに処理されます。

PS。 Ubuntu16.04へのMariaDBのインストールに関するこの投稿が気に入った場合 、下のボタンを使用してソーシャルネットワークで友達と共有するか、単に返信してください。ありがとう。


Panels
  1. Ubuntu16.04にRをインストールする方法

  2. Ubuntu18.04にGoをインストールする方法

  3. Ubuntu20.04にERPNextをインストールする方法

  1. Ubuntu18.04にKanboardをインストールする方法

  2. Ubuntu20.04にNextcloudをインストールする方法

  3. Ubuntu20.04にGiteaをインストールする方法

  1. Ubuntu18.04にMariaDB10.4をインストールする方法

  2. Ubuntu18.04にMariaDBをインストールする方法

  3. Ubuntu20.04にMariaDBをインストールする方法