• Hi,

    I’d like to create WordPress sites in a CI environment (connected to an external database) using a script with the following command:

              wp core install \
    --allow-root \
    --path="$WP_CORE_PATH" \
    --url="$WORDPRESS_SITE_URL" \
    --title="$WORDPRESS_SITE_TITLE" \
    --admin_user="$WORDPRESS_ADMIN_USERNAME" \
    --admin_password="$WORDPRESS_ADMIN_PASSWORD" \
    --admin_email="$WORDPRESS_ADMIN_EMAIL" \
    --skip-email

    The database already exists and is empty.

    However, I sometimes notice that the administrator user is not created with ID 1, but with ID 2 or 3.

    Why can this happen? Is it possible to force the administrator user to have ID 1?

    For context, I’m using the official WordPress Docker container, on which I’ve installed WP-CLI.

    Thank you very much

    Claudio

    • This topic was modified 2 months, 1 week ago by Imageioclaudio.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Imagethreadi

    (@threadi)

    I would say that it is more a question of the database system which ID is generated. It is of course strange why the first autoincrement value should not be 1 for a newly created database table, but it is possible. WordPress does not control this further, and as far as I can see, there is no control option for this in WordPress.

    You might be able to control this if you explicitly set the autoincrement value of the user table to 1 before executing the WP CLI command. How you do this depends on your database system.

    Thread Starter Imageioclaudio

    (@ioclaudio)

    Hi,
    yes, that’s true, perhaps the issue is related to the containers from the Helm chart, because even using wp cli cache clear and similar commands, the problem persists.
    Or it could be due to the fact that for MariaDB I’m using a three-node cluster, and when deleting tables from phpMyAdmin the nodes might not be synchronized.
    I’ll see if I can isolate the problem.
    Thanks for the response.

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.