在樹莓派上安裝mysql/MariaDB

stpeace發表於2017-12-12

        MariaDB是MySQL的一個分支,由開源社群在維護。開發這個分支的原因是:甲骨文公司收購了MySQL後,有將MySQL閉源的潛在風險,因此社群採用分支的方式來避開這個風險。MariaDB的目的是完全相容MySQL,能輕鬆成為MySQL的代替品。

        在樹莓派上安裝mysql,  結果預設安裝的是maria db(當然, 究竟是mysql還是maria db, 這個樹莓派裝的系統有關),  樹莓派真會擁抱開源啊。 呵呵噠, 來看看安裝:

sudo apt-get update #更新軟體庫
sudo apt-get install mysql-server #安裝mysql,期間如果要求輸入密碼, 那就輸入吧. 
sudo mysql -u root -p #登入mysql檢視是否安裝成功


        登入後, 是這樣的(我發現,空密碼也可以登入):

pi@raspberrypi:~/taoge $ sudo mysql -u root -p                       
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 16
Server version: 10.1.23-MariaDB-9+deb9u1 Raspbian 9.0

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

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

MariaDB [(none)]> 
MariaDB [(none)]> 
MariaDB [(none)]> 
MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
+--------------------+
3 rows in set (0.00 sec)

MariaDB [(none)]> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [mysql]> show tables;
+---------------------------+
| Tables_in_mysql           |
+---------------------------+
| column_stats              |
| columns_priv              |
| db                        |
| event                     |
| func                      |
| general_log               |
| gtid_slave_pos            |
| help_category             |
| help_keyword              |
| help_relation             |
| help_topic                |
| host                      |
| index_stats               |
| innodb_index_stats        |
| innodb_table_stats        |
| plugin                    |
| proc                      |
| procs_priv                |
| proxies_priv              |
| roles_mapping             |
| servers                   |
| slow_log                  |
| table_stats               |
| tables_priv               |
| time_zone                 |
| time_zone_leap_second     |
| time_zone_name            |
| time_zone_transition      |
| time_zone_transition_type |
| user                      |
+---------------------------+
30 rows in set (0.00 sec)

MariaDB [mysql]> 
      不多說。







相關文章