Re: [sr-dev] [kamailio/kamailio] "kamdbctl create" creates the same user twice which fails (Issue #3280)

2022-11-23 Thread Daniel-Constantin Mierla
I tried and all works fine. Also, a few weeks ago I was in a team of about 10 
persons that each run the command for kamailio 5.6.x on Debian 11 and nobody 
reported similar issue. It can be a matter of kamctlrc options, but discussing 
about configuring Kamailio or its tools has to be done on 
sr-us...@lists.kamailio.org mailing list. If it proves to be actually a 
problem, this can be reopened.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3280#issuecomment-1324786885
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] "kamdbctl create" creates the same user twice which fails (Issue #3280)

2022-11-23 Thread Daniel-Constantin Mierla
Closed #3280 as completed.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3280#event-7875383420
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] "kamdbctl create" creates the same user twice which fails (Issue #3280)

2022-11-22 Thread Henning Westerholt
Thanks for the report. Surely the DB scripts can be improved in several areas, 
and also made more robust in case they are executed several times. If you have 
some improvement ideas, please create a pull request that we can review it and 
also integrate into the git repository.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3280#issuecomment-1323306242
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] [kamailio/kamailio] "kamdbctl create" creates the same user twice which fails (Issue #3280)

2022-11-15 Thread Tommy Falgout
### Description

When running kamdbctl for the first time with `DBENGINE=MYSQL` , it will try to 
create the same user twice which causes a failure.  Because the user is already 
there, the create fails and the install script fails

As a new user this is very confusing as it leads you to believe that you're 
blocked.  However, if you enable prompt and run it twice and then skip adding 
access the second time, you can continue. 

```
root@924dfe238957:/# /usr/sbin/kamdbctl create
Create the database 'kamailio'? (y/n): y
-e \E[37;33mINFO: creating database kamailio ...
Create database users with access privileges? (y/n): y
-e \E[37;33mINFO: granting privileges to database kamailio ...
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 
'kamailio'@'mariadb'
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 
'kamailioro'@'mariadb'
```

### Troubleshooting


If you modify `./usr/lib/x86_64-linux-gnu/kamailio/kamctl/kamdbctl.mysql` to 
echo the command instead, then you get the following debugging info.

```
root@924dfe238957:/# /usr/sbin/kamdbctl create
Create the database 'kamailio'? (y/n): y
-e \E[37;33mINFO: creating database kamailio ...
mysql -h mariadb -P 3306 -uroot -ppasswd -e CREATE DATABASE kamailio CHARACTER 
SET latin1;
Create database users with access privileges? (y/n): y
-e \E[37;33mINFO: granting privileges to database kamailio ...
mysql -h mariadb -P 3306 -uroot -ppasswd -e CREATE USER 'kamailio'@'mariadb' 
IDENTIFIED BY 'kamailiorw';
GRANT ALL PRIVILEGES ON kamailio.* TO 'kamailio'@'mariadb';
mysql -h mariadb -P 3306 -uroot -ppasswd -e CREATE USER 'kamailioro'@'mariadb' 
IDENTIFIED BY 'kamailioro';
GRANT SELECT ON kamailio.* TO 'kamailioro'@'mariadb';
mysql -h mariadb -P 3306 -uroot -ppasswd -e CREATE USER 'kamailio'@'localhost' 
IDENTIFIED BY 'kamailiorw';
GRANT ALL PRIVILEGES ON kamailio.* TO 
'kamailio'@'localhost';
mysql -h mariadb -P 3306 -uroot -ppasswd -e CREATE USER 
'kamailioro'@'localhost' IDENTIFIED BY 'kamailioro';
GRANT SELECT ON kamailio.* TO 
'kamailioro'@'localhost';
mysql -h mariadb -P 3306 -uroot -ppasswd -e CREATE USER 'kamailio'@'mariadb' 
IDENTIFIED BY 'kamailiorw';
GRANT ALL PRIVILEGES ON kamailio.* TO 
'kamailio'@'mariadb';
mysql -h mariadb -P 3306 -uroot -ppasswd -e CREATE USER 'kamailioro'@'mariadb' 
IDENTIFIED BY 'kamailioro';
GRANT SELECT ON kamailio.* TO 
'kamailioro'@'mariadb';
```

As you can see ` 'kamailioro'@'mariadb'` and ` 'kamailioro'@'mariadb'` are 
added twice which creates a 1396 error.

 Reproduction

```


```


-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3280
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev