Zend certified PHP/Magento developer

How to set magento 2 sudo chown -R username:www-data

I’m using ubuntu 22.04 to install magento2.4.6, but I’m confused about sudo chown -R user_name:www-data ., what should the user_name be, ubuntu or root. The default ssh user of ubuntu 22.04 is ubuntu.

enter image description here
enter image description here

mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'demo12345679!';
mysql> CREATE USER 'magento'@'localhost' IDENTIFIED BY 'demo12345679!';
mysql> ALTER USER 'magento'@'localhost' IDENTIFIED WITH mysql_native_password BY 'demo12345679!';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'magento'@'localhost' WITH GRANT OPTION;
mysql -u magento -p
mysql> CREATE DATABASE magento;