Edit sqlite file from terminal Mac

筅森魡賤 提交于 2019-12-11 03:26:55

问题


I can not find any documents where I can open existing sqlite database file that I made from the terminal on Mac. I want to add some additional rows to the existing database. I probably search for the wrong things, so anything that points me in the right direction is much appriciated.


回答1:


If you want to remain in the Terminal, you can open a sqlite3 database using the command sqlite3 [databasename]. From here, you can select rows or insert new ones using SQL commands. If you prefer a GUI, there are many to choose from, including the free Firefox plugin, sqlite-manager.




回答2:


Whenever you work with Mac built-in sqlite3 it saves the files in the current folder where your Terminal is and the way you can access them is the reversed story, open sqlite3 while you are at the folder where your database is.




回答3:


Find and get precompiled binaries for OSX. Use the command line client.




回答4:


I realize this is a bit tangential to the question, but it's helpful to be able to find/move hidden files in Finder, because often sqlite DBs will wind up in a hidden folder. See:

http://www.macworld.com/article/1051830/showallfinder.html

The key bit is to enter this in the Terminal, then force Finder to relaunch (via the Apple menu's Force Quit on Lion):

defaults write com.apple.Finder AppleShowAllFiles YES

Change that to NO at the end to toggle it off.



来源:https://stackoverflow.com/questions/5180895/edit-sqlite-file-from-terminal-mac

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!