#100945vendor/bin/setup fails if port is not passed as option and host is "localhost"
Description
Port has a default of 3306, so this shouldn’t fail.
Reproduce
on DB (with existing user “typo3”):
mysql> create database t3intro12 CHARACTER SET utf8 COLLATE utf8_general_ci;
mysql> grant all on t3intro12.* to `typo3`@`localhost`;
composer create-project typo3/cms-base-distribution:^12 t3intro12
cd t3intro12
./vendor/bin/typo3 setup --driver=mysqli --host=localhost --dbname=t3intro12 --username=typo3 --password='a34234Sfb8GHf!' --project-name=t3intro12 --force -n
For TYPO3 13, it needs some additional parameters, e.g.
vendor/bin/typo3 setup --driver=mysqli --host=localhost --dbname=t3intro13 --username=typo3 --password='mypasswd...' --project-name=t3intro13 --force -n --admin-username=system --admin-user-password='mypasswd' --admin-email="myemail@mydomain"
Result
In SetupCommand.php line 428: Please use a port in the range between 1 and 65535.
Expected result
Port is default 3306, so port is set correctly and this should not fail, see
./vendor/bin/typo3 setup -h
Versions
- reproduced with TYPO3 12 base distribution
- reproduced with TYPO3 13 base distribution
Workaround
Pass the port explicitly, e.g.
./vendor/bin/typo3 setup —driver=mysqli —host=localhost —dbname=t3intro12 —username=typo3 —password=‘a34234Sfb8GHf!’ —project-name=t3intro12 —force -n —port=3306
Reviews 2
History 714
-
Sybille Peters changed description 06/03/23, 05:40
-
Benni Mack changed Sprint Focus Stabilization Sprint 06/06/23, 12:46
-
Johannes Nielsen commented 06/12/23, 06:54
-
Sybille Peters commented 06/12/23, 07:09
> host, dbname and username also have default values. Would it make sense to make those optional, too?
It depends if the default values actually make sense and you would use them in most cases.
- host: default is “db”.
- dbname: default is “db”
- username: default is “db”
I don’t think the defaults “db” are good defaults here but that is just my opinion. I would not make them optional.
-
Gerrit Code Review pushed patch set 1 for main to change 79257 status
NewUnder Review 06/12/23, 08:28 -
Johannes Nielsen commented 06/12/23, 08:31
Sybille Peters wrote in #note-4:
> > host, dbname and username also have default values. Would it make sense to make those optional, too?
>
> It depends if the default values actually make sense and you would use them in most cases.
>
> * host: default is “db”.
> * dbname: default is “db“
> * username: default is “db“
>
> I don’t think the defaults “db” are good defaults here but that is just my opinion. I would not make them optional.Those are the default values which ddev uses. I agree that whether these make sense depends heavily on the individual project/setup and that it probably does not make sense to make them optional.
-
Gerrit Code Review pushed patch set 2 for main to change 79257 06/12/23, 09:15
-
Gerrit Code Review pushed patch set 3 for main to change 79257 06/13/23, 08:42
-
Gerrit Code Review pushed patch set 4 for main to change 79257 06/13/23, 08:47
-
Gerrit Code Review pushed patch set 5 for main to change 79257 06/13/23, 08:53
-
Gerrit Code Review pushed patch set 6 for main to change 79257 07/03/23, 15:45
-
Gerrit Code Review pushed patch set 1 for 12.4 to change 79831 07/06/23, 18:23
-
Anonymous commented and changed status
Under ReviewResolved done0 %100 % 07/06/23, 18:25Applied in changeset commit:1ccaef4f16b55a5ada0fd14905ad4f19320477d5.
-
Benni Mack changed status
ResolvedClosed 07/09/24, 14:15
host, dbname and username also have default values. Would it make sense to make those optional, too?