#Database creation with commands

13 messages · Page 1 of 1 (latest)

broken forge
#

Hi !

I'm trying to automate the installation of my panel but I find myself facing a problem...

There isn't any command to configure the database ( not the environment one ). I've found node, location, but nothing about database.

So I've done my research and I've found that the databases are stored into the panel.database_hosts. So with an INSERT SQL request, I can create it.

But problem, I can't find how to encrypt the password of the database like if we create one directly into the panel.
So if we create a database on a server, it won't work because he don't recognize the password.

Can someone help me to figure it out how to do this ?

Thanks in advance.

mild nicheBOT
#

Please explain the issue you're experiencing in as much detail as possible. Preferably with error messages in a text format or paste link to logs. Nobody can assist you without information that helps to understand the issue. Help us help you. Messages such as "doesn't work" or "i need help" will most likely be ignored.

cold abyss
#

Did you mod the panel or anything? The database tab should show up in admin settings, above nodes

broken forge
#

It showed up
That's not the problem ^^

I trying to automate all the panel side configuration

#

So without use the panel
Just commands

stone lagoon
#

There is no command for creating database hosts

#

And manually inserting data into mysql is always a bad idea

#

So you would need to modify the code

cold abyss
#

The issues you think are going to happen have no current reason to appear, they work for everyone else

broken forge
#

When I create the database directly with the INSERT request, the database is created

But I can't use it probably because of the password, which is normally encrypt

#

----------------------------------------------------------------------------+---------------+---------+---------------------+---------------------+
| id | name | host | port | username | password
| max_databases | node_id | created_at | updated_at |
+----+-------+---------------+------+-----------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------+---------+---------------------+---------------------+
| 8 | test | myIp | 3306 | pterodactyluser | admin1234
| NULL | NULL | NULL | NULL |
| 9 | test2 | myIp | 3306 | pterodactyluser | eyJpdiI6ImFrbnJRNE1udTNHakNSNCtqb2lMNWc9PSIsInZhbHVlIjoiZUVHdHY4cEJIOXlqMmR1Y2ZuVUNUbjhZeGZZRzhXckg2WjZIWUo0WVRpTT0iLCJtYWMiOiIxZDE1MjQ0ZTBlYTRmNWYyNzc1OWI3N2RjMDBlYjc1NWQ3YjViYjMwYjUzNDAzYzI5ZGNjMWRiYzQwNTUzNzYwIiwidGFnIjoiIn0= | NULL | NULL | 2023-09-22 22:19:23 | 2023-09-22 22:19:23 |

#

test is the database created with the INSERT statment

And test2 is the database created on the panel