Re: mariadb-admin flush logs?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 18, 2025 at 12:05 AM Alex <mysqlstudent@xxxxxxxxx> wrote:
> Also, can I ask a somewhat related question? When I look in my ~/.mysql_history, the above line is recorded with \40 representing the spaces.
> How do I just have it record the actual spaces instead?
> grant\040reload\040on\040*.*\040to\040'mysql'@'localhost';

Please think of the ".mysql_history" file as a file with a binary
format, managed by the MariaDB or MySQL application, and with which
the users are not expected to work with directly.
The fact it appears (at least partly) human-readable, iat s just
incidental, thanks to the underlying implementation of the code that
manages the history.

This is the case since early MariaDB 10.5.

There are a lot of posts around the internet with trivial hacks to
replace the escape sequences with the actual characters,
look around to see what will suit you. But note that that's not the
only difference from the actual true history.

I'd strongly recommend neither to mess with the binary data the
EditLine wrapper stores for the history to work,
nor to rely on the false feeling that what you see there is the 1:1
representation of what the history functionality gives you.

Michal

--

Michal Schorm
Software Engineer
Databases Team
Red Hat

--

On Fri, Apr 18, 2025 at 12:05 AM Alex <mysqlstudent@xxxxxxxxx> wrote:
>
> Hi,
>
>> Historically, when the 'mariadb-admin' / 'mysql-admin' was used, it
>> first needed to be configured, so the 'mariadb-admin' / 'mysql-admin'
>> would have the necessary login credentials available.
>>
>> That changed starting MariaDB 10.4, with the unix socket
>> authentication, as described in the logrotate file:
>>   https://github.com/MariaDB/server/blob/main/support-files/mariadb.logrotate.sh#L43
>> which we slightly patch for Fedora:
>>   https://src.fedoraproject.org/rpms/mariadb10.11/blob/rawhide/f/mariadb-logrotate.patch
>>
>> The unix socket authentication in MariaDB was designed in such a way
>> that it automatically allows login from the system 'root user and the
>> account owning the DB files - usually 'mysql' user. The logic behind
>> being that both those accounts can tamper with the DB files in any
>> way, so there's no point in denying them the access to the DB
>> directly.
>>   https://mariadb.com/kb/en/authentication-plugin-unix-socket/
>> That said, it should work seamlessly out of the box.
>>
>> I tried to disable the unix socket authentication, which led to this output:
>>  | # mariadb-admin --local flush-error-log flush-engine-log
>> flush-general-log flush-slow-log
>>  | mariadb-admin: connect to server at 'localhost' failed
>>  | error: 'Plugin 'unix_socket' is not loaded'
>>
>> So more likely, you configured a specific protocol to be used for the
>> client as the preferred or only variant available.
>> That can be configured for specific types of clients and tools, as can
>> be seen in the '/etc/my.cnf.d/mysql-clients.cnf' configuration file.
>>   https://github.com/MariaDB/server/blob/main/support-files/rpm/mysql-clients.cnf
>>
>> When you configure e.g.
>>  | [mysqladmin]
>>  | user=mysql
>>  | protocol=tcp
>
>
> The [mysqladmin] section in /etc/my.cnf.d/mysql-clients.cnf was empty. I've updated it to include:
>
> [mysqladmin]
> user=mysql
> protocol=tcp
>
> I've also added granted reload access from my mariadb command line:
>
> MariaDB [(none)]> grant reload on *.* to 'mysql'@'localhost';
>
> Also, can I ask a somewhat related question? When I look in my ~/.mysql_history, the above line is recorded with \40 representing the spaces. How do I just have it record the actual spaces instead?
>
> grant\040reload\040on\040*.*\040to\040'mysql'@'localhost';
>
> Thanks,
> Alex
>
> --
> _______________________________________________
> users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
> To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
> Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx
> Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue

-- 
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux