Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create user failed #4

Open
ramezrafla opened this issue Apr 21, 2020 · 5 comments
Open

Create user failed #4

ramezrafla opened this issue Apr 21, 2020 · 5 comments

Comments

@ramezrafla
Copy link

@Gelembjuk

Hope all is well, sent you a message on linked-in
We tried oursql as a replacement for mysql in one of our apps and it failed during initialisation:

create user --> ERROR 4 (HY000): Unknown query type

How would we use oursql in production?

@Gelembjuk
Copy link
Owner

Hello,
You need to execute this query out of OurSQL proxy. Just connect directly to a server DB and create it.
And it must be repeated on every server .

On practice you must have some initial set up of a DB before using oursql.

Also, user doesn't matter. Every ourSQL node can have own user for a DB. Users should not be synced

@ramezrafla
Copy link
Author

Thanks @Gelembjuk for your quick reply

This would complicate things in production, say for a multi-tenant application where a new dB is created for every new client.

A solution would be to convert this command to an insert in table mysql.user (like we used to do for old versions of MySQL)

@ramezrafla
Copy link
Author

ramezrafla commented Apr 21, 2020

@Gelembjuk

Our tests have failed. The fact that you don't support so many initialising functions such as create user, create db etc. makes it next to impossible to use in production. We have to do a lot of customisation to our app before we can fully test.

We definitely need support for create database and failing gracefully on create user (i.e. no errors returned)

We can be a great use case: here is our website https://www.office2.io

@Gelembjuk
Copy link
Owner

You still can do all initialization directly to on the DB server.
When you app first time starts on new node and needs init, just connect to mysql/mariadb server an do all things. Create user, create DB etc.
When all is done, do rest of work with ourSQL.
OurSQL is designed to work with a single database. Doesn't matter what user and how the DB is named. User and DB name can be different on every node. Only tables and data in tables are synced between nodes.

@ramezrafla
Copy link
Author

Thank you -- will follow this advice and share our results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants