--- title: image: description: tags: Language,SQL --- # MariaDB ### 基本操作 ```c= select * FROM seeds; UPDATE seeds SET seed_status = 1 WHERE seed_id =3333; desc seeds; show tables; use smartdb; DELETE FROM seeds WHERE seed_id=61911; sudo mysql -u root //刪除表格 DROP TABLE Firestation; //顯示 Table 資料型態 show columns from smartdb.Firestation; //中文 ?? ALTER database smartdb character set utf8; //關聯資料表 select * From firestation INNER JOIN firestation_car ON firestation.team_name = firestation_car.team_name; //刪除 firestation table DROP TABLE Firestation; // 觀看 smartdb.FirestationCar 欄位屬性 show columns from smartdb.FirestationCar; ``` ### [刪除 MariaDB](https://unix.stackexchange.com/questions/375471/failed-to-start-mariadb-database-server-after-upgrade-to-debian-9) sudo apt purge mysql* sudo apt purge mariadb* sudo apt autoremove sudo apt autoclean ### 觀念 * [[資料庫] 關聯介紹 一對一、一對多、多對多](https://notes.andywu.tw/2018/%E8%B3%87%E6%96%99%E5%BA%AB-%E9%97%9C%E8%81%AF%E4%BB%8B%E7%B4%B9-%E4%B8%80%E5%B0%8D%E4%B8%80%E3%80%81%E4%B8%80%E5%B0%8D%E5%A4%9A%E3%80%81%E5%A4%9A%E5%B0%8D%E5%A4%9A/) * [Python 的 Import 陷阱](https://medium.com/pyladies-taiwan/python-%E7%9A%84-import-%E9%99%B7%E9%98%B1-3538e74f57e3) ### 基礎 * [MySQL/MariaDB 新增資料庫、建立使用者帳號與資料表指令教學](https://blog.gtwang.org/linux/mysql-create-database-add-user-table-tutorial/) * [MariaDB插入中文出現???情況](https://www.itread01.com/content/1500525488.html) * [[教學] MariaDB/MySQL 常用指令操作與語法範例](https://www.jinnsblog.com/2017/08/mysql-mariadb-sample.html) * [Python 使用 MySQL Connector 操作 MySQL/MariaDB 資料庫教學與範例](https://officeguide.cc/python-mysql-mariadb-database-connector-tutorial-examples/) * [MySQL/MariaDB 資料庫 JOIN 查詢兩張資料表教學與範例](https://officeguide.cc/mysql-mariadb-database-left-right-inner-cross-join-tutorial-examples/) ```c= //因為 python import 我還不是很熟悉,所以先用了絕對路徑來用檔案 //如果你要操作以下檔案 //FireStationCSV_2_Dict.py //MariaDB_Firestation_car_INSERT.py //MariaDB_Firestation_INSERT.py python3 -m SQL_Table.MariaDB_Firestation_INSERT //請記住要到上層資料夾(SQL_data_preprocess),因為他們現在在這裡母資料夾底下 ``` ### Json send & received & web operation >[Sending JSON Data Using Python Requests](https://www.youtube.com/watch?v=jx9kiXJaUzg) >[如何擷取解析 JSON 資料](https://medium.com/datainpoint/scraping-json-with-python-requests-95a56e61096a) >[傳送與接收 JSON](https://openhome.cc/Gossip/JavaScript/JSON.html) >[Quickstart Make a Request](https://requests.readthedocs.io/en/master/user/quickstart/) >[Python 使用 requests 模組產生 HTTP 請求,下載網頁資料教學](https://blog.gtwang.org/programming/python-requests-module-tutorial/) >[How to get JSON from a request using Flask in Python](https://www.kite.com/python/answers/how-to-get-json-from-a-request-using-flask-in-python) >[python-requests 發送和接收JSON](https://sodocumentation.net/zh-tw/python-requests/topic/3099/%E7%99%BC%E9%80%81%E5%92%8C%E6%8E%A5%E6%94%B6json) ### 操作 >[[Flask教學] Flask-SQLAlchemy 資料庫連線&設定入門(一)](https://www.maxlist.xyz/2019/11/10/flask-sqlalchemy-setting/) >>:+1:[Using jQuery to Update HTML Without Refresh (Part 1 of 2)](https://www.youtube.com/watch?v=Kcka5WBMktw&t=68s) >:+1:[Using jQuery to Update HTML Without Refresh (Part 2 of 2)](https://www.youtube.com/watch?v=A291yJ92154&t=394s) ### 資料型態 >[SQL varchar data type deep dive](https://www.sqlshack.com/sql-varchar-data-type-deep-dive/) >:+1:[資料庫中如何儲存經緯度](https://www.itread01.com/content/1541899936.html) >:+1:[GPS座標值轉換- [度]與[度分秒]的轉換](https://hiking.biji.co/index.php?q=review&act=info&review_id=5989) ### 編譯問題 >[Instance of 'SQLAlchemy' has no 'Column' member (no-member)](https://stackoverflow.com/questions/53975234/instance-of-sqlalchemy-has-no-column-member-no-member) >[Instance of 'SQLAlchemy' has no 'Column' member 錯誤](https://blog.csdn.net/stone0823/article/details/90488029) ## 計數器 >[Flask結合APScheduler實現定時任務](https://www.twblogs.net/a/5d70785ebd9eee5327ff5d0b) ## JavaScript >[JS 利用ajax發出POST請求,並使用json內容格式](http://www.jysblog.com/coding/web/js-%E5%88%A9%E7%94%A8ajax%E7%99%BC%E5%87%BApost%E8%AB%8B%E6%B1%82%EF%BC%8C%E4%B8%A6%E4%BD%BF%E7%94%A8json%E5%85%A7%E5%AE%B9%E6%A0%BC%E5%BC%8F/) ## 遠端連線 >[linux系统(ubuntu)如何查看ip地址](https://blog.csdn.net/u012269267/article/details/52260757) >[如何連線到遠端的Linux + MySQL伺服器?](https://magiclen.org/mysql-remote) >[如何允許遠端連線到MySQL資料庫伺服器?](https://www.gushiciku.cn/pl/pmp7/zh-tw)