postman訪問mysql數據庫

一、準備環境,安裝nodejs和xmysql

1、安裝nodejs 

2、安裝xmysql 

二、postman對接mysql

1、啓動xmysql服務

xmysql -h host_name -u user_name -p user_password -d database_name

2、postman連接數據庫

啓動xmysql後,即可通過http://localhost:3000/api/ 訪問 xmysql 自動生成的 Rest API,詳細的使用方法可通過https://github.com/o1lab/xmysql查看

備註:localhost是mysql服務要啓動的機器的ip,3000是xmysql服務默認端口,可在啓動時通過-r修改

postman輸入接口http://localhost:3000/api/表名?條件,訪問成功,如圖

 

 

內容來自:https://blog.csdn.net/weixin_30888027/article/details/97741283?depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章