欢迎投稿

今日深度:

在树莓派上安装mysql/MariaDB,mysqlmariadb

在树莓派上安装mysql/MariaDB,mysqlmariadb


        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]> 
      不多说。







www.htsjk.Com true http://www.htsjk.com/mariadb/35198.html NewsArticle 在树莓派上安装mysql/MariaDB,mysqlmariadb         MariaDB是MySQL的一个分支,由开源社区在维护。开发这个分支的原因是:甲骨文公司收购了MySQL后,有将MySQL闭源的潜在风险,因此社区采用...
相关文章
    暂无相关文章
评论暂时关闭