No Access on InfluxDB ERR: 401 Unauthorized: unauthorized access

Hello,
I have a VPS server to log my data from PV and some weather data. recently I wanted to upgrade some other issues on the server, where I got an error, that the public key of influxDB was not found. Somehow I managed to reinstall influxDB, but since then it does not work any more. By now, the problem with the public key is solved, but now I have the even more severe problem, that InfluxDB is not available any more.

My server runs on Ubuntu 22.04 LTS. I think before influxDB ran on version 1.8.x. Usually data are saved in InfluxDB via NodeRed and visualized by Grafana. The old database was secured with authentication (User admin).

What did I do?

  1. Try to reinstall InfluxDB 1
    Uninstallation of old version
dpkg --list          --> check for packages ti uninstall
sudo apt-get remove influxdb influxdb2
sudo apt-get purge influxdb influxdb2
sudo apt-get autoremove
sudo apt-get clean

Installation of new version

apt -y install influxdb influxdb-client
systemctl restart influxdb
systemctl status influxdb

I tried this probably 2 or 3 times. The old database seems to stay there at /var/lib/influxdb
I just found out that I have only access as root. how can I change that to my normal users access or is it nit necessary?

After installation, I got a message 401, that I do not have access to do anything within influx in after terminal command ‘influx’. I tried
create user admin with password 'adminpassword' with all privileges
but this also generated the no access error

Thus, I tried to go with InfluxDB v2.

curl -LO https://download.influxdata.com/influxdb/releases/influxdb2_2.7.6-1_amd64.deb
sudo dpkg -i influxdb2_2.7.6-1_amd64.deb
sudo service influxdb start
sudo service influxdb status

Influx CLI

wget https://download.influxdata.com/influxdb/releases/influxdb2-client-2.7.5-linux-amd64.tar.gz
sudo tar xvzf ./influxdb2-client-2.7.5-linux-amd64.tar.gz

Here I still have the problem of no access, as described above. I do not really know, where I can enter my admin-Username and password. Do I need to set it new or is it stored in the old database?

I am very new to influxDB and not super familiar, so probably it is an easy error, but I do not find it. It would be great, if you can give me a hint, how to get my influxDB with the old data running again.

BR Stefan