Linux: (03.04.01) Hướng dẫn cài đặt MariaDB v5.5 CentOS 7 (64bit) trước khi cài đặt FusionPBX cho FreeSwitch v1.6

By , 0 View

Mục tiêu thực hành:
- Khởi động và kiểm tra trạng thái MariaDB trên CentOS 7.
- Khởi tạo MySQL Database.
- Thiết lập ODBC.
- Kiểm tra driver và kết nối odbc.

Các bước triển khai:
Khởi động và kiểm tra trạng thái MariaDB trên CentOS 7.
[root@localhost run]# systemctl start mariadb
[root@localhost run]# systemctl status mariadb
● mariadb.service - MariaDB database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
   Active: active (running) since Thu 2021-05-06 11:04:20 +07; 1min 13s ago
  Process: 27471 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exited, status=0/SUCCESS)
  Process: 27388 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=0/SUCCESS)
 Main PID: 27470 (mysqld_safe)
   CGroup: /system.slice/mariadb.service
           ├─27470 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
           └─27635 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/log/mariadb/mariadb.log --pid-file=/var/run/mariadb/mariadb.pid --s...

May 06 11:04:18 localhost.localdomain mariadb-prepare-db-dir[27388]: MySQL manual for more instructions.
May 06 11:04:18 localhost.localdomain mariadb-prepare-db-dir[27388]: Please report any problems at http://mariadb.org/jira
May 06 11:04:18 localhost.localdomain mariadb-prepare-db-dir[27388]: The latest information about MariaDB is available at http://mariadb.org/.
May 06 11:04:18 localhost.localdomain mariadb-prepare-db-dir[27388]: You can find additional information about the MySQL part at:
May 06 11:04:18 localhost.localdomain mariadb-prepare-db-dir[27388]: http://dev.mysql.com
May 06 11:04:18 localhost.localdomain mariadb-prepare-db-dir[27388]: Consider joining MariaDB's strong and vibrant community:
May 06 11:04:18 localhost.localdomain mariadb-prepare-db-dir[27388]: https://mariadb.org/get-involved/
May 06 11:04:18 localhost.localdomain mysqld_safe[27470]: 210506 11:04:18 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.
May 06 11:04:18 localhost.localdomain mysqld_safe[27470]: 210506 11:04:18 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
May 06 11:04:20 localhost.localdomain systemd[1]: Started MariaDB database server.
[root@localhost run]# 

Khởi tạo MySQL Database.
[root@localhost run]# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 5.5.68-MariaDB MariaDB Server

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

MariaDB [(none)]> CREATE DATABASE freeswitch;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> 

MariaDB [(none)]> GRANT ALL PRIVILEGES ON freeswitch.* TO fusionpbx@localhost IDENTIFIED BY 'admin@2021';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> 

MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> \q
Bye
[root@localhost run]# 

Thiết lập ODBC.
- Khởi tạo mới file odbc.ini với nội dung như bên dưới.
nano /etc/odbc.ini

[freeswitch]
Driver   = MySQL
SERVER   = 127.0.0.1
PORT     = 3306
DATABASE = freeswitch
OPTION  = 67108864
Socket   = /var/lib/mysql/mysql.sock
threading=0
MaxLongVarcharSize=65536

[fusionpbx]
Driver   = MySQL
SERVER   = 127.0.0.1
PORT     = 3306
DATABASE = fusionpbx
OPTION  = 67108864
Socket   = /var/lib/mysql/mysql.sock
threading=0


Kiểm tra driver và kết nối odbc.
[root@localhost mysql]# odbcinst -s -q
[freeswitch]
[fusionpbx]
[root@localhost mysql]# 

[root@localhost mysql]# isql -v freeswitch fusionpbx admin@2021
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL> quit
[root@localhost mysql]# 

Mọi thắc mắc các bạn vui lòng liên hệ với mình thông qua kênh Zalo (Jade Bùi) 076.877.2021.

You Might Also Like

0 comments