- OS : Ubuntu 18.04.1 LTS
- DBMS : mysql 8.0.12
- blog : blog.csdn.net/shiwanwu
- typesetting : Markdown
數據,數據,命根就在數據 ! 操作數據庫時,一定要謹慎小心。師萬物 的代碼看看就好,要有自己的判斷。遇到抉擇,要不恥上下問。
example
stu@Ubuntu:~$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 41
Server version: 8.0.12 MySQL Community Server - GPL
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> use db_chinese_medicine;
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
mysql> select * from t_fruit;
+----+-----------+-------+--------+----------+------------------------------------+---------------------+---------------------+
| id | name | count | price | is_sales | note | gmt_create | gmt_modified |
+----+-----------+-------+--------+----------+------------------------------------+---------------------+---------------------+
| 1 | 甜瓜 | 10 | 3.210 | 1 | 無 | 2018-10-27 19:42:56 | 2018-10-27 19:42:56 |
| 2 | 烏梅 | 20 | 5.430 | 1 | 無 | 2018-10-27 19:46:21 | 2018-10-27 19:46:21 |
| 3 | 櫻桃 | 30 | 6.540 | 1 | 無 | 2018-10-27 19:46:48 | 2018-10-27 19:46:48 |
| 4 | 甘蔗 | 50 | 7.650 | 0 | 無 | 2018-10-27 19:51:13 | 2018-10-27 19:51:13 |
| 5 | 菠蘿蜜 | 50 | 8.760 | 1 | 菠蘿蜜和菠蘿是什麼關係? | 2018-10-27 19:55:44 | 2018-10-27 19:55:44 |
| 6 | 無花果 | 100 | 8.760 | 1 | 無 | 2018-10-27 19:57:48 | 2018-10-27 19:57:48 |
| 7 | 山葡萄 | 200 | 5.550 | 1 | 無 | 2018-10-27 20:11:07 | 2018-10-27 20:11:07 |
| 8 | 無漏子 | 5 | 3.320 | 0 | 無 | 2018-10-27 20:11:07 | 2018-10-27 20:11:07 |
| 9 | 五斂子 | 12 | 6.010 | 0 | 無 | 2018-10-27 20:11:07 | 2018-10-27 20:11:07 |
| 10 | 藕 | 80 | 10.200 | 0 | 無 | 2018-10-27 20:11:07 | 2018-10-27 20:11:07 |
+----+-----------+-------+--------+----------+------------------------------------+---------------------+---------------------+
10 rows in set (0.00 sec)
mysql> select * from t_fruit order by count asc;
+----+-----------+-------+--------+----------+------------------------------------+---------------------+---------------------+
| id | name | count | price | is_sales | note | gmt_create | gmt_modified |
+----+-----------+-------+--------+----------+------------------------------------+---------------------+---------------------+
| 8 | 無漏子 | 5 | 3.320 | 0 | 無 | 2018-10-27 20:11:07 | 2018-10-27 20:11:07 |
| 1 | 甜瓜 | 10 | 3.210 | 1 | 無 | 2018-10-27 19:42:56 | 2018-10-27 19:42:56 |
| 9 | 五斂子 | 12 | 6.010 | 0 | 無 | 2018-10-27 20:11:07 | 2018-10-27 20:11:07 |
| 2 | 烏梅 | 20 | 5.430 | 1 | 無 | 2018-10-27 19:46:21 | 2018-10-27 19:46:21 |
| 3 | 櫻桃 | 30 | 6.540 | 1 | 無 | 2018-10-27 19:46:48 | 2018-10-27 19:46:48 |
| 4 | 甘蔗 | 50 | 7.650 | 0 | 無 | 2018-10-27 19:51:13 | 2018-10-27 19:51:13 |
| 5 | 菠蘿蜜 | 50 | 8.760 | 1 | 菠蘿蜜和菠蘿是什麼關係? | 2018-10-27 19:55:44 | 2018-10-27 19:55:44 |
| 10 | 藕 | 80 | 10.200 | 0 | 無 | 2018-10-27 20:11:07 | 2018-10-27 20:11:07 |
| 6 | 無花果 | 100 | 8.760 | 1 | 無 | 2018-10-27 19:57:48 | 2018-10-27 19:57:48 |
| 7 | 山葡萄 | 200 | 5.550 | 1 | 無 | 2018-10-27 20:11:07 | 2018-10-27 20:11:07 |
+----+-----------+-------+--------+----------+------------------------------------+---------------------+---------------------+
10 rows in set (0.00 sec)
mysql> exit
Bye
stu@Ubuntu:~$
resource
- [手冊] dev.mysql.com/doc
- [源碼] downloads.mysql.com/archives/community
- [Bug ] bugs.mysql.com
- [ 測試數據 ] github.com/datacharmer/test_db
- [規範 - 參考] yq.aliyun.com/articles/69327
- [排名 - 參考] db-engines.com/en
- [平臺] www.csdn.net
MySQL是關係型數據庫管理系統,目前是開源的(2019-02)。
明確權限,恰當地選擇引擎與字符集等,規範命名。
MariaDB,Redis,MongoDB,PostgreSQL,Hive,HBase等,多作了解,拓寬心量。
Workbench,phpMyAdmin,Navicat等圖形化管理工具,豫兮若冬涉川。