opennetadmin / ona

OpenNetAdmin IP Address Management (IPAM) system
opennetadmin.com
GNU General Public License v2.0
136 stars 34 forks source link

Creating SQL users #149

Closed dmgeurts closed 4 years ago

dmgeurts commented 4 years ago

installcli.php uses a single line to create a user and grant privileges. On Ubuntu 19.10 with the default mysql server (MadiaDB), this fails:

GRANT ALL ON ona_default.* TO 'ona_sys'@'localhost' IDENTIFIED BY 'password';

But this works:

CREATE USER 'ona_sys'@'localhost' IDENTIFIED BY 'password'; GRANT ALL ON ona_default.* TO 'ona_sys'@'localhost';

I know MariaDB 10 does support the concise format but v8 doesn't.

dmgeurts commented 4 years ago

Additionally, I had to do: ALTER USER 'ona_sys'@'localhost' IDENTIFIED with mysql_native_password BY 'password';

So a better solution for the installation scripts is: CREATE USER 'ona_sys'@'localhost' IDENTIFIED with mysql_native_password BY 'password'; GRANT ALL ON ona_default.* TO 'ona_sys'@'localhost';

mattpascoe commented 4 years ago

Ahh yes, this is the sort of thing I mentioned in the other ticket.. just need some re-formatting. The with mysql_native_password is also important on the newer versions.

I Just need to work up the specific format and test it a few times. What you have here is pretty close though.