You are not logged in.

#1 2013-03-26 15:04:56

javex
Member
Registered: 2011-12-30
Posts: 77

MariaDB allowing login without command line password

Hi,

Today I have upgraded to MariaDB as recommended. I am currently in configuration process and didn't want my cronjobs to run with a command line password for MySQL. Thus I searched and came up with three different solutions (found on SO). None of these options work for me.

Note: I did not try thins on native MySQL so this issue might not strictly be with MariaDB, but I cannot know.

The methods described in the answers where:
- Placing a users ".my.cnf" in his home dir and inserting this:

[client]
password = my_secret_pass

- Setting the MYSQL_PWD variable:

MYSQL_PWD="my_secret_pass" mysql -u username -p

- Changing the default searched file ".my.cnf" to something different.

mysql --defaults-file=my_user_login.cnf -u username -p

I also tried a fourth method: Just editing the global "my.cnf" in "/etc/mysql/". There was already a line like this:

#password = your_password

I changed that and restarted the mysql service. Stil running

mysql -u username -p

asks for a password.

When running

mysql --defaults-file

it complains

mysql: unknown option '--defaults-file'

But when running

mysql --help

it says this:

Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf
The following groups are read: mysql client client-server client-mariadb
The following options may be given as the first argument:
--print-defaults        Print the program argument list and exit.
--no-defaults           Don't read default options from any option file.
--defaults-file=#       Only read default options from the given file #.
--defaults-extra-file=# Read this file after the global files are read.

I have tried those options, with and without the "=" but it complains that they are not present.

Google on this only spit out that MariaDB behaves on this like MySQL does (they link to the MySQL docs).

The last fallback idea would now be that Arch has disabled this behaviour during compile time (but why is the doc then there?). Is anyone able to help me on this issue? Thanks in adavnce.

Offline

Board footer

Powered by FluxBB