Closed ponasromas closed 1 year ago
I haven't really used wp db create
so I might be missing something but shouldn't it take the value from wp-config.php
? What use case do you have for using a custom one?
Yes, this value is set in wp-config.php. use case would be to increase resistance for SQL injection by randomizing db prefix. Security via obscurity.
Another use case would be multiple WP installations on the same database.
Looks like you could this to change the prefix after creating the DB: https://github.com/iandunn/wp-cli-rename-db-prefix (changing it both in DB and wp-config.php
)
The database prefix is defined in wp-config.php
and can be configured when running wp config create
.
The database doesn't really know of WordPress' database prefix.
Feature Request
Please add option to wp db create command to set custom database table prefix.
wp db create --dbuser=<value> --dbpass=<value> --prefix=<prefix[optional]>
Thank you.