It seems like the question of how to use the bolt protocol (or HTTP) with Neo4j is super common amongst newer Neo4j developers, especially when it produces errors, and it is most often searched by the phrase bolt://localhost:7687 or http://localhost:7474, or “Neo4j 7474”, or “Neo4j url”, especially when moving from Neo4j local access to Neo4j remote access (e.g. over network, in which case developers seem to search for “neo4j remote access bolt”).
COMMON ERROR: Accessing bolt://localhost:7687
Many times if a developer is trying to access Neo4j, they can get an error like this as they attempt to swap out bolt and HTTP/REST protocols in the URL, and that is usually because they use different default ports (see next section):
Exception in thread "main" org.neo4j.driver.v1.exceptions.ClientException: Unsupported URI scheme: http at org.neo4j.driver.internal.DriverFactory.createDriver(DriverFactory.java:125) at org.neo4j.driver.internal.DriverFactory.newInstance(DriverFactory.java:82) at org.neo4j.driver.v1.GraphDatabase.driver(GraphDatabase.java:136) at org.neo4j.driver.v1.GraphDatabase.driver(GraphDatabase.java:119) at org.neo4j.driver.v1.GraphDatabase.driver(GraphDatabase.java:94) at neo4j.Neo4j.<init>(Neo4j.java:19) at neo4j.Neo4j.main(Neo4j.java:50)
CORRECT SYNTAX: To Use Bolt Protocol to Access your Neo4j DB
There are actually two main ways to access your Neo4j database through the bolt protocol, or through HTTP/REST. They each use a different port, and here are syntax examples for each, with the correct ports:
- HTTP/REST: default Neo4j http port is 7474
- Neo4j URL syntax for HTTP / REST: http://localhost:7474 / rest://localhost:7474
- BOLT: default Neo4j bolt port is 7687
- Neo4j bolt URL syntax: bolt://localhost:7687
SOLUTION: For Accessing a Neo4j Database Over the Network
By default Neo4j is configured to simply listen on local, so almost always for Neo4j remote access, if you are unable to connect (and if you are using the correct port as described above) the issue is that there is a single line that is commented out in the neo4j.conf file. All you have to do is uncomment the following line, and it should work.
If you have questions on this or anything else related to Neo4j / Neo4j consulting or reselling, Hume / Hume consulting or reselling or anything about graph-based AppDev in general? Contact us today to catch up with one of our graph experts.
Graphable delivers insightful graph database (e.g. Neo4j consulting) / machine learning (ml) / natural language processing (nlp) projects as well as graph and Domo consulting for BI/analytics, with measurable impact. We are known for operating ethically, communicating well, and delivering on-time. With hundreds of successful projects across most industries, we thrive in the most challenging data integration and data science contexts, driving analytics success.
Want to find out more about our Hume consulting on the Hume knowledge graph / insights platform? As the Americas principal reseller, we are happy to connect and tell you more. Book a demo by contacting us here.
Check out our article, What is a Graph Database? for more info.