Database C++

Please tell me how to connect to the database server via C ++? I tried to MySQL, but I constantly crawl errors due to the fact that ConnectorC ++ for MySQL compiled on VS2010, and I’m using VS2017. Can I use SQLite for MMO project?

Well, thank you very much for your help. I would like to know whether it is possible to build a MMO using a SQLite database? Is it possible to find a hosting with the ability to install SQLite?

Yes, you can use any database you want with UE4, but you have to use unmanaged C++ libraries to access the database.

Since I have been working on connecting UE4 to a backend database for the past 2 years, I will let you know some of what has worked for me and what hasn’t.

So I started out like you and tried to directly connect Microsoft SQL to my dedicated UE4 server so I could build an MMO. I got it all working, but quickly realized that it doesn’t scale well and was fairly ugly and hard to manage. So then I built a brand new database system that sits behind a web API and is accessed from UE4 using JSON calls. This is working much better now. It also allows me to easily scale up to dozens of servers and create a world of any size I want that can accommodate thousands of players.

The JSON server is built with ASP .NET / MVC 5. I originally used the VaREST plugin to connect to my JSON server, but now I just use direct HTTP calls.

If you have any specific questions, let me know.

I’ve done it, so it is definitely possible. It is a lot of work though. I spent the last 6 months building my system. For development purposes you can just run SQLite directly on your PC. When you need to do more complicated testing you can use cheap virtual hosts. Microsoft SQL Express is free, so I personally prefer it over SQLite.

Well, thanks for the help. Sorry for my English, I use Google translator, I’m from Russia :slight_smile: As far as I understand to use the JSON, neobhodibo work with PHP? I do not know much the whole system, you will forgive me … I would like to work directly, using only the features of C ++.

I’ve spent the last year working with AWS DynamoDB from within Unreal. Similar HTTP request with Json data approach.

The header signing process took me a while. If I were to start from scratch I’d take a much harder look at integrating a library to do it (think that the open source lib would be where I’d start looking).

No idea how the AW services map to your problem, but they definitely scale well!

This is what I am using:

Sorry for these stupid questions, I am a beginner programmer: how to get a JSON string from a site using C ++? Do I need to do to use the sockets?

Thank you so much!

Hope this plugin can help you.

HiSQLite3( SQLite3 For UE4)