Right way of accessing database via client tool?

Hey, I am trying to install Strapi on a custom server.
I already have data that I would like to import.
Unfortunately, I am not able to access the database with some GUI client.

My Database is MySQL 5.7

I tried the phpmyadmin preset site provided by cleavr.
=> Installation worked, access did not.

I used BeeKeeper.
=> SSH tunnel seams to work (user: cleavr), but without further explanation the database is not accessable.

I am confused by the following warning:

When installing databases, Cleavr locks down root access to external client tools. This is for security. To access using a client tool, make sure you have added a database user and password and use those credentials for external clients. Also, during provisioning, Cleavr creates a ‘cleavr’ user on the server which is not granted database access. This is also for security reasons.

The description above this warning tells to use cleavr and the warning says you shouldn’t (access with root as user is actually not working “Permission denied (publickey).”)
And…do I have to create another database user to access the database? I tried to create a new user, but cleavr returns an error: “Error creating database user.”
This is not really explaining what happend.

I am stuck here and would love to understand what is going on and what I have to do.

Hi @Matthi,

I also has some hairpulling before i managed to connect to a DB on a Cleavr server.

When through Cleavr setting up an Hetzner server i got this on mail:

HETZNER
Server Private IP: null

Server Name: xxxxxxxxxx

Sudo Password: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Server Public IP: XXX.XXX.XX.XX

Sudo Username: root

Database Password: XXXXXXXXXXXXXX

Username: cleavr

Database User: cleavr

I attache an image from TablePlus i use and really can recommend

Good luck and have a nice day

1 Like

Can you check the MySQL service heartbeat from server > services? In this case, it sounds like there may be some issue with the db service such as it is stopped for some reason or maybe didn’t properly install.

Hey @peterc,
thank you very much for your advice.
I will check this when my service is running again :+1:
Have a nice weekend!

Hey @amiedema,
although I’m quite sure that everything was green yesterday, indeed mysql isn’t running (anymore?!?).

Unit mysql.service could not be found.

Can I reinstall mysql with cleavr?

Try removing MySQL from the services section and the reinstall it. Then, check the heartbeat to make sure everything is running properly.

Let me know if that doesn’t fix it and I’d be happy to take a closer look.

I removed it successfully and reinstalled it.
Service was green/active.
I tried to create a database. That failed.
Switched back to services and MySQL was still active/green.
Made a healthcheck then it switched to error/red and said…

Unit mysql.service could not be found.

:man_shrugging:

That’s weird. Sorry about that. Let us have a look.

The issue seems to be that mysql installation is looking to add initial config values in a file that seems to not exists on your server /etc/mysql/mysql.conf.d/mysqld.conf

I just provisioned a server and installed MySQL successfully on a few different servers. This could be because you have a custom server and the MySQL apt package being pulled in is different? I’ve not seen this before.

I can go ahead and set it up for you for now to unblock you. Otherwise, it might take us a few more hours to get to the root of it. Let me know if you want me to have it set up and ready.

1 Like

Thanks for investigating this. I DM you.

1 Like