For example, I have neo4j Desktop running on my machine that can be accessed by:
This is the project named 'Project' by default, and the database is named 'Graph' by default.
For testing, I want to create another project named 'Project 1' and the database is named 'Graph' be default again. Now , in access the two databases, how to specify which database that I want to connect in browser?
Just a slight terminology fix, Neo4j Desktop allows creation of multiple dbms, not databases. Only one can be run at a single time.
If you want to use a single dbms that allows creation and usage of multiple databases simultaneously, then you'll need to launch an instance for 4.0.x from Neo4j Desktop, then switch to the system db and create your other databases:
To make it easier, can I install another neo4j instance, which is has nothing to the existing neo4j installation? In such a case, how to connect the two different instances on the same machine? For example, use another port different from '7474'?
My database version is 3.5.2
I don't use Neo4j Desktop. The installation is the tar file which I installed on a remote linux.
You had mentioned Neo4j Desktop being used in your first post, but I guess you were referring to a remote connection to this instance?
Are we still talking about two instances on the same remote machine? Or are we talking about different instances on different remote machines?
Sorry about that. Let's just talk about the possibility of having two Neo4j installations on the same local machine so that I can create two different graph. Hopefully I can use two different ports to refer to each?
OR, the possibility of two different DBMSes on the same neo4j installation so that I can create two different databases. Again on the same local machine.
In both cases, I haven't upgraded to 4.0 version. 3.5.17 only.
Yes, you'll need to change the ports of the other instances in their neo4j.conf so as not to conflict.
That's great to know and thanks.
Also make sure you're careful about how you set your heap and pagecache memory settings, since both instances are sharing the same hardware.
It's strange that I downloaded the 3.5.17 tar file to my mac, untar it and changed the port configs in the conf/ directory. Then I went to the bin/ and execute:
It doesn't really execute this version of neo4j, but it still executes my desktop version of neo4j, which is 3.5.12, which is installed in another directory:
/Users/min/Library/Application Support/Neo4j Desktop/Application/neo4jDatabases/database-b719f648-a8e5-4a16-a1af-8174f09ea344/installation-3.5.12
I didn't set a $NEO4J_HOME/bin and how it points to that executable?
Is there any particular reason why you're using the console? You would normally start Neo4j with
./neo4j start, from the bin directory of the instance.
I can use the start, but I got the same result. There may be something weird. But for this particular problem, I found that I can create another project in desktop, create a new graph in the new project, and switch to this new project to work on the new graph. The original graph in old project remains intact, which is what i want for testing.
This seems like a great situation to use docker, but I only spin up one container at a time. How-To: Run Neo4j in Docker - Developer Guides
I am curious to know how you are getting on with this?
To my knowledge, and have double checked from the link @andrew.bowman shared. You will have to use 4. 0 above version to run multiple databases, in a single RDBMS.
' Managing Multiple Databases in Neo4j
In this guide, we will walk through how to manage multiple database within the Neo4j DBMS.
Please have Neo4j (version 4.0 or later) downloaded and installed.'
I am also interested in setting this up, as in the past (my little experience on windows local host), two related graph database can't be accessed at the same time. One has to be closed before the other one is open.
Hope I am not misleading,
I'm also new to Neo4J. I use the "community edition". My reading of the documentation is that only one DBMS at a time is supported (by the community edition). Am I missing something?
I simulate the behavior I want by stopping the instance, replacing the contents of the files it uses (in
/var/lib/neo4j) and restarting (I run on a CentOS 7 platform).
It would be nice if there was a more graceful way to accomplish this.
In 4.0.x community edition, per dbms, you will only have access to the neo4j db, and the system db (which is reserved for admin/security and not available to be used as a general db).
If you're running Neo4j 3.5.x or below, you can use change the neo4j.conf config property dbms.active_database to change which database the dbms will use, this may be easier for you than replacing file contents.
It will still require a shutdown before you change the config property though.