how to install and run SQLite or SQL on a Mac? - sqlite

i am trying to install and run SQLite or SQL on my mac. I installed the application, but it's not giving me the option to run it. It says its not compatible with the developer. Thank you.

SQLite is already installed on the Mac. Go to Terminal create a directory e.g. sqlite by typing Mkdir sqlite, next type cd sqlite, now type sqlite3 mytest.db.
You should see something like: SQLite version 3.19.3 2017-06-27 16:48:08. The prompt will also change to sqlite>, type .help for a list of commands. I hope this helps.

Related

How to find SQLITE database version in pycharm db extension

I'm working in windows and I'm using pycharm to code in and manage my sqqlite db. How to I check the sqllite version. I tried the standard terminal command as in the screen shot, but it does not run.
Haven't tried it on Windows but on Linux you can import the sqlite3 on the python console of PyCharm and then enter
sqlite3.sqlite_version
to get the version of SQLite library. I do not see the reason for not being the same on Windows as well.
To add on that you can do the same through the terminal by calling the Python IDLE Shell by typing python and then:
import sqlite3
sqlite3.sqlite_version

Navicat installation Error -libmysql_d.dll

I am trying to install Navicat on windows 10 for SQLite purpose.
Here is error shown while starting install --click on navicat.exe file
Just restart the system and it will work fine . error is coming due to not find the path of sqllite file in C drive.
This is a frequently issue.The directly and quickly resolution is re-install the Navicat.
You can also try to search the file 'libmysql_d.dll' in your environment or try to find it in the Navicat install folder, and copy it to 'C:\Windows\SysWOW64\'.
for 64-bit version of Window, otherwise, please copy to 'C:\Windows\System32'.
You can also download it from http://www.opendll.com/index.php?file-download=libmysql.dll&arch=32bit&version=. and copy.
then you can uninstall the navicate and again install the navicate than it will work fine thanks

Can't open Sqlite on Git Bash

I'm trying to access my sqlite database on my current directory at /c/wamp/www/laravel5 on my local project folder, with windows as my OS. I added the sqlite3 executable on the directory.
The database doesn't seem to open using git bash. When using the default command in windows command prompt it works seamlesly. sqlite3.exe storage/database.sqlite
Tried on Git Bash:
$ ./sqlite3.exe
and
$ ./sqlite3.exe storage/database.sqlite
These didn't work.
The error message is:
bash: sqlite3.exe: command not found
Here's a snapshot:
I'd like to see the database tables and schema using git bash since it has cooler font colors compare with the windows cmd.
Any help would be greatly appreciated.
if you have the same problem I had, then see my question here.
In short, using "winpty" to start sqlite3 worked:
$ winpty sqlite3
Building on the previous answer by #user172431, add the following alias to your .bashrc
alias sqlite3="winpty sqlite3.exe"
This will make the workflow a tad quicker and feel like a ninja rock-star in the process. I use this shortcut via Git Bash

SQL Chiper command line

Can anybody advice me what I need to do in order to open ciphered (http://sqlcipher.net/) database in command line.
When I try to do something with it like watch schema it response with following message
sqlite> .schema
Error: file is encrypted or is not a database
I know password for db, I just want to figure out steps how to correctly open it. My OS is Ubuntu 11.10
Finally I managed to do that, in case if somebody need it, here is my steps:
I've started from http://sqlcipher.net/introduction/ & downloaded sqlcipher.
The first problem was for me that I was unable to configure and build it from source because I have no libcrypto.a which is part of openssl crypto libraries.
I've installed it apt-get install libssl-dev
Then I successfully configured sqlcipher running
$./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto"
$make
after that executable sqlite3 file was created and I was able to open ciphered database.
To provide a password you should execute following statement.
PRAGMA key='password'

How to convert sqlite2 to sqlite3 and what are the differences between both versions?

I need to convert from sqlite2 db to sqlite3, is there any tutorial that shows how to do it? And if I migrate correctly what to expect as I start the project?
The SQLite website says:
sqlite OLD.DB .dump | sqlite3 NEW.DB
where sqlite is version 2 and sqlite3 is version 3.
Converting an SQLite2 database to an SQLite3 database on Windows
-- Step-by-step instructions --
1- Download SQLite2 and SQLite3 command-line tools
Download links:
sqlite.exe
http://web.archive.org/web/20031203050807/http://sqlite.org/download.html
(Precompiled Binaries For Windows)
sqlite3.exe
http://www.sqlite.org/download.html
(Precompiled Binaries for Windows)
2- Copy sqlite.exe, sqlite3.exe and the db to convert to the same folder (i.e.: D:\TEMP)
3- Open a Windows command prompt ( [WINDOWS KEY] + [R], then type "cmd" or via the Start Menu)
4- Browse to the folder where you've just copied the files (i.e.: type "D:", then "cd temp")
5- Type "sqlite OLD.DB .dump | sqlite3 NEW.DB" (without the quotes), where OLD.DB is the db file you want to convert and NEW.DB is the name of the converted file that will be created.
Hope this helps.
EDITED: ANSWER TO THE QUESTION
To the conversion
Go to http://www.sqlite.org/download.html
Download sqlite-dll file (which stays in Precompiled Binaries For Windows)
Unpack it and copy to C:\Windows\System32 folder
What are the differences? (quoted from PHP - SQLite vs SQLite3)
SQLite2 internally stores every value as a string, regardless of its type.
Upgrading to SQLite3 will certainly shrink the database size since numbers and BLOBS get stored in their native formats, which could make things run faster.
starting from 3.6.23 version it supports foreign keys.

Resources