Click here to Skip to main content
15,936,499 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have tried time and again to set up multiple SQL services on a Linux machine and I cannot get it to work. Does anyone have an easy solution? what worked for you?

What I have tried:

I'm in tutorial hell for the Linux Terminal..
Updated 12-Oct-21 6:44am

Apart from what others have answered in their solutions, if you intended to use Microsoft SQL Server on Linux, then you can download it and use their Developer edition.

Installation guidance for SQL Server on Linux - SQL Server | Microsoft Docs[^]
Share this answer
See this overview: relational-databases[^]
I would recommend PostgreSQL, there even seems to be a portable version: PostgreSQL Portable download |[^]
You might also be interested in this article: Managing Multiple PostgreSQL Instances on Ubuntu/Debian - DZone Database[^]

An easier option might be to use a: postgresql-as-a-service-provider[^]
And if your needs are simple: LiteDB[^]
Share this answer
If you want something really simple for single user use then try SQLite Home Page[^].
Share this answer
The exact instructions will depend on which version of Linux you are using. Assuming you are using a Debian derived distribution (e.g Debian, Ubuntu, RPIOs, etc), the following should get you a PostgreSQL database installed and ready to use. We start by assuming that you can log in as user 'myuid' and have sudo access.
#start by checking which version of postgresql is available for your distribution
[myuid@myhost]:~ $ apt list postgresql-*
#This will produce a long list of available packages.  You want to look for something that looks like postgresql-13/hirsute-updates,hirsute-security 13.4-0ubuntu0.21.04.1 amd64
#This is for Ubuntu 21.10, your version might be postgresql-11 or posgresql-12, or perhaps even postgresql-9 if you are using an older distribution.
#Now install the postgresql package
[myuid@myhost]:~ $ sudo apt install postgresql-13
#this will download, install and initialize the database engine for you
#in order for the user 'myuid' to get access, you will need to create a myuid user and a myuid database
[myuid@myhost]:~ $ sudo su - postgres -c "createuser myuid"
[myuid@myhost]:~ $ sudo su - postgres -c "createdb myuid"
#You should now be able to access the database via the psql command.
[myuid@myhost]~ $ psql 
psql (13.4 (Ubuntu 13.4-0ubuntu0.21.04.1), server 12.8 (Ubuntu 12.8-0ubuntu0.20.04.1))
Type "help" for help.

myuid=> /q
[myuid@myhost]~ $

The procedure for other databases are similar. If you choose to use MySQL/MariaDB or Firebird, you'll have to do some research on how to create users and databases and what the CLI command is for them. Another possibility is to uses SQLite, which has some limitations since it is not a full DBMS - but if you're only interested in learning SQL, its a good place to start.
Note that the 'postgresql-13' package does not include any of the development packages. If you are wanting to do programming, you will, at a minimum, want to install postgresql-server-dev-13 package. Replace 13 with 11, 12 or 9 as per your installed postgresql package. You may then want to add python or C++ or other language support, if available, if you are looking at using something other than programming in C
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900