Skip to content

"wp db query" is ignoring "--defaults" option #291

Closed as duplicate
Closed as duplicate

Description

@MoogyG

I use "--defaults" argument for "wp db export", "wp db import", "wp db reset" because I use a non SSL Mariadb Server.

Here is my ".my.cnf" :

[client]
skip-ssl = true

But it doesn't work for "wp db query", i get the error "Error: Failed to get current SQL modes. Reason: ERROR 2026 (HY000): TLS/SSL error: SSL is required, but the server does not support it"

Reproduced with cli 2.12 and 2.11.

Thanks.

Activity

  1. added
    command:db-query
    on Jul 15, 2025
  2. mrsdizzie commented on Jul 23, 2025

    @mrsdizzie
    Member

    This should work the same as other commands

    public function query( $args, $assoc_args ) {
    $command = sprintf(
    '/usr/bin/env %s%s --no-auto-rehash',
    $this->get_mysql_command(),
    $this->get_defaults_flag_string( $assoc_args )
    );

    what is the output when using --debug ?

  3. mrsdizzie commented on Jul 23, 2025

    @mrsdizzie
    Member

    I see, this is a duplicate of #237

    Will take a look 👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    command:db-query

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions