How to create/assign a MariaDB user

  • i have two accounts on the system - root and a user account (vhost1) - and i’m trying to setup a single website
  • i’m trying to install ClassicPress (forked from WP 4.9)

when i go to Virtualmin > Edit Databases > Manage > Return to database list (which seems like a non-intuitive way to get to this screen, unless i’m missing something) > User Permissions > vhost1… there’s a message:

Warning! WARNING : This MariaDB user is the administration login for Virtualmin domain 12bytes.org. Changing any settings here may cause errors in Virtualmin.

i don’t really understand a) the meaning of that message, b) how to set db permissions for that user, or c) why there’s no db permissions set which is causing the ClassicPress installer to fail

Rather than question the user friendliness of the Virtualmin interface, which has been used by so many people for so many years, you would do well to question yourself and what you must unlearn and relearn in order to be able to use new tools.

To create a database, go to Virtualmin > Edit Databases and hit the button to create a new database.

Virtualmin will instantly create a database and assign it to the user who owns the virtual server you currently have on the screen. I don’t think there can be a simpler way to create a database. It is you who is making things complicated by fiddling with user permissions, an advanced feature of Virtualmin intended to be used by people who know what they are doing.

i wasn’t knocking webmin in general - i was pointing out that getting to that particular page was a lengthy process - if i didn’t like, i wouldn’t be using it

so started fresh, again; deleted the user, virtual server, db, etc

created a new virtual server, choosing mostly defaults (i added an ssh key) and set up a LE cert

then i logged out and logged back in as the new user and uploaded the ClassicPress installer > unzipped it > moved the files where they were supposed to go and nothing more

then i loaded the website and tried to do the ClassicPress install and experienced exactly the same as before…

installer fails after editing db credentials and clicking ‘next’
http status code 500
environment: Webmin/Virtualmin on Ubuntu 22.x LTS, LAMP stack

[Sat Dec 31 19:40:04.001464 2022] [fcgid:warn] [pid 190960:tid 140079240934976] [client 45.15.18.66:40376] mod_fcgid: stderr: PHP Fatal error:  Uncaught mysqli_sql_exception: Access denied for user 'one2bytes'@'localhost' (using password: YES) in /home/one2bytes/public_html/wp-includes/wp-db.php:1542, referer: https://12bytes.org/wp-admin/setup-config.php?step=1
[Sat Dec 31 19:40:04.001501 2022] [fcgid:warn] [pid 190960:tid 140079240934976] [client 45.15.18.66:40376] mod_fcgid: stderr: Stack trace:, referer: https://12bytes.org/wp-admin/setup-config.php?step=1
[Sat Dec 31 19:40:04.001504 2022] [fcgid:warn] [pid 190960:tid 140079240934976] [client 45.15.18.66:40376] mod_fcgid: stderr: #0 /home/one2bytes/public_html/wp-includes/wp-db.php(1542): mysqli_real_connect(), referer: https://12bytes.org/wp-admin/setup-config.php?step=1
[Sat Dec 31 19:40:04.001506 2022] [fcgid:warn] [pid 190960:tid 140079240934976] [client 45.15.18.66:40376] mod_fcgid: stderr: #1 /home/one2bytes/public_html/wp-admin/setup-config.php(273): wpdb->db_connect(), referer: https://12bytes.org/wp-admin/setup-config.php?step=1
[Sat Dec 31 19:40:04.001508 2022] [fcgid:warn] [pid 190960:tid 140079240934976] [client 45.15.18.66:40376] mod_fcgid: stderr: #2 {main}, referer: https://12bytes.org/wp-admin/setup-config.php?step=1
[Sat Dec 31 19:40:04.001510 2022] [fcgid:warn] [pid 190960:tid 140079240934976] [client 45.15.18.66:40376] mod_fcgid: stderr:   thrown in /home/one2bytes/public_html/wp-includes/wp-db.php on line 1542, referer: https://12bytes.org/wp-admin/setup-config.php?step=1

so from Webmin i checked the user permissions on the db and again none were set - why the ‘access denied’ log line, i don’t know since i accepted all the defaults when creating the VS, other than adding an ssh key

Steps to reproduce

  1. install Virtualmin LAMP stack
  2. create virtual server
  3. run CP installer

You shouldn’t need to edit permissions. Though I agree it’s a bit convoluted to get to editing permissions from Virtualmin. It’s not something that should ever come up, though…Virtualmin users already have permission to do everything with their own databases, and the root user would generally get there directly from the MySQL module if they did need to do something specific with a given database or user.

Can you try installing WordPress using the Install Scripts interface just so we can confirm nothing is actually wrong with databases and permissions being created by Virtualmin?

wp install was flawless (i was thinking earlier of hacking that script to wget the classicpress installer, but too complicated for lil ol me)

however i noticed some things … i wonder if the lack of these modules would interfere with the classicpress installer? particularly ssh2 and curl???

Installing required PHP gd module ..
.. done
Installing recommended PHP curl module ..
.. done
Installing recommended PHP ssh2 module ..
.. done
Installing recommended PHP pecl-ssh2 module ..
.. not available in repos
Installing recommended PHP imagick module ..
.. done
Installing recommended PHP pecl-imagick module ..
.. not available in repos

Those messages are wholly unrelated to database access, and are harmless. Virtualmin tries to install several different named packages because the packages can be named a variety of things across supported distros…it is expected than many will fail.

Since your WordPress install complete successfully, you can look in the wp-config.php to see the database details that are known to work (username and password) and you can use that for your other apps. Presumably you’ve specified something wrong when trying to configure Classic Press.

didn’t try another install yet, but i see the db pwd was el-wrong-o - thanks for the tip - i never thought of that - no wonder you get the Big Bucks :moneybag:

so i set passwords to be stored encrypted for users (me being the only user), plus i use long and complex passwords (stuff like E+R]Lt3?VJ[b{!x*K[:n.>Eq,)>:) - is it possible v-min decided to create a new db pwd cuse it didn’t like/couldn’t read mine?

If you store passwords encrypted, Virtualmin doesn’t know the domain user password, and creates a new password for the database user (which is does know, so it can install applications using that user).

To be clear, you can check the database password for the user in the Edit Databases page for the domain.

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.