Raspberry PI 安裝、設定 MariaDB

本版討論Raspberry PI相關技術開發、設計與應用
回覆文章
inho
文章: 27
註冊時間: 2017-12-08, 23:00

Raspberry PI 安裝、設定 MariaDB

文章 inho » 2018-01-29, 12:36

// 從系統預設的版本安裝

Installing MariaDB database server and command line client on Raspbian Stretch

$ sudo apt-get install mariadb-server mariadb-client -y
$ sudo apt-get install mariadb-server mariadb-client
// 初始化 MariaDB:

$ sudo mariadb
> use mysql;
> update user set password=PASSWORD("new_password"), plugin = '' where User='root';
> flush privileges;
> exit

$ sudo mysql -u root -p
Enter password:new_password

重新啟動 MariaDB,並設定開機自動啟動:
$ sudo systemctl restart mysqld.service
$ sudo systemctl enable mysqld.service

Installing PHP 7 on Raspbian Stretch
$ sudo apt-get install php7.0 php7.0-fpm php7.0-mysql -y
After the installation had completed, I entered the following command to check the status:
$ systemctl status php7.0-fpm.service

Seeing the following output assured me that my PHP Fast CGI Manager had started successfully:

php7.0-fpm.service - The PHP 7.0 FastCGI Process Manager
Loaded: loaded (/lib/systemd/system/php7.0-fpm.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2018-02-04 23:01:23 CST; 35s ago
Docs: man:php-fpm7.0(8)
Main PID: 10679 (php-fpm7.0)
Status: "Processes active: 0, idle: 2, Requests: 0, slow: 0, Traffic: 0req/sec"
CGroup: /system.slice/php7.0-fpm.service
├─10679 php-fpm: master process (/etc/php/7.0/fpm/php-fpm.conf)
├─10680 php-fpm: pool www
└─10681 php-fpm: pool www

2月 04 23:01:23 BullPI systemd[1]: Starting The PHP 7.0 FastCGI Process Manager...
2月 04 23:01:23 BullPI systemd[1]: Started The PHP 7.0 FastCGI Process Manager.

回覆文章