Possibility to change SQL script after create new database by user?

hockolicious

Verified User
Joined
Jun 20, 2019
Messages
70
Location
Poland
Hello,

In directadmin is possibility to change sql query script after creating database with user by directadmin user? I wan't to add 1 more hosts to users, now I have only localhost.
 
log in as user that created database, in "MySQL Management" click at database name, there you can see "Access Hosts" just add there all you want.
 
Of course, I know how to add remote hosts manually. I am interested in editing the global script, which is responsible for generating the database and creating the user - so as to add a remote host at this level and block the possibility of its removal by the user.
 
In such case you must create databases manually, and disable GRANT for this user.
For automatical database creation you can use:
user_create_post.sh or domain_change_post.sh located in: /usr/local/directadmin/scripts/custom/
 
Maybe I still don't understand how it works in the user_create_post script? Do you have any examples that illustrate the situation when a user creates a database and a user and you automatically add him additional rights or a host? I want the script to download data given in the panel such as name, user, password. I am only interested in adding the external IP address and blocking it from being removed from the panel.
 
panel works with da_admin (mysql root) privileges, so user always can change db-user attributes.
In such case you must create database or via console without user access to modify db-user attributes, or you can create another directadmin account and create all limited databases via regular MysqlManagement, add hosts, disable GRANT, and give credentials to user.
user_create_post.sh - it's a regular shell (bash) script which runs on every user creation.
 
Okay, then we forgot to lock this from user panel but how I can add another host when user create a database? Any examples?
 
Through user's Mysql Management, or via mysql command like: GRANT ALL ON *.* TO 'myuser'@'another.host';
 
I know a basic SQL Query but I need a example in custom directadmin script to automate this when user's creating database/user
 
Back
Top