Re: mariadb-admin flush logs?

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

 



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
[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