Bug 1260821

Summary: mysql_secure_installation ignores custom config
Product: [Fedora] Fedora Reporter: Stan King <stanley.king>
Component: mariadbAssignee: Michal Schorm <mschorm>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 24CC: hhorak, jstanek, mmuzila
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-09 20:55:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1346768    

Description Stan King 2015-09-08 00:45:21 UTC
Description of problem:

The mysql_secure_installation script seems to the contents of the global config file.  For example, in my case, I've directed the socket to a different file than the default.

The root cause seems to be that the script creates a temporary config file in an effort to avoid supplying the database password on the command line when doing database operations.

I was able to work around this by using the internally-documented "defaults-file" option:

   mysql_secure_installation --defaults-file=/etc/my.cnf.d/client.cnf

which caused it to pick up my socket redirection.

Perhaps the script could be fixed, or the work-around documented.

Version-Release number of selected component (if applicable):

mariadb-server-10.0.21-1.fc22.x86_64

How reproducible:

Every time.

Steps to Reproduce:
1. Prepare a mariadb installation with a different socket specified in mariadb-server-10.0.21-1.fc22.x86_64
2. run "mysql_secure_installation"
3.

Actual results:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2 "No such file or directory")

Expected results:

Normal execution of script.

Additional info:

Comment 1 Fedora End Of Life 2016-07-19 17:48:39 UTC
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 2 Honza Horak 2016-08-08 13:16:36 UTC
This seems to not been properly investigated. Reopening.

Comment 3 Michal Schorm 2016-12-20 04:38:03 UTC
This is a bit old report, so let's talk about current rawhide or F25.

I tried to pick clean F25 machine.
I installed mariadb and set socket location generally in /etc/my.cnf, and made sure, there is no re-definition of this option.

I confirm, the "mariadb_secure_installation" script won't take it, unless manually specified by option, as you wrote:
 " mysql_secure_installation --defaults-file=/etc/my.cnf "

Also, I confirm, mysql_secure_installation script creates some temporary config files. If the "--defaults-file" option is present, it will copy its target content to one of those temporary config files. (in make_config() function)

--

So far, I see two options.
1) Document the option, as you suggested
2) Patch the mysql_secure_installation, so the /etc/my.cnf would be deafult, if exists. (Which should be consulted with upstream)

I will examinate it further.

Comment 4 Michal Schorm 2017-01-02 08:36:28 UTC
Created an issue on the upstream JIRA with request for man page extension:

https://jira.mariadb.org/browse/MDEV-11702

Comment 5 Michal Schorm 2017-01-10 07:58:13 UTC
The task reported to the upstream has been processed and the fix is expected to show up in one of the next versions.

Comment 6 Michal Schorm 2017-01-19 18:31:11 UTC
The fix was included in the MariaDB 10.1.21 version.

Revision #9a4bc0d in changelog: https://mariadb.com/kb/en/mariadb/mariadb-10121-changelog/

Comment 7 Fedora Update System 2017-01-27 11:40:14 UTC
mariadb-10.1.21-1.fc24 mariadb-10.1.21-1.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2017-0f44f2b8c8

Comment 8 Fedora Update System 2017-01-27 11:47:21 UTC
mariadb-10.1.21-1.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2017-0f44f2b8c8

Comment 9 Fedora Update System 2017-01-27 11:48:49 UTC
mariadb-10.1.21-1.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-801e01d1ed

Comment 10 Fedora Update System 2017-01-29 02:21:24 UTC
mariadb-10.1.21-1.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-0f44f2b8c8

Comment 11 Fedora Update System 2017-01-29 02:22:04 UTC
mariadb-10.1.21-1.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-801e01d1ed

Comment 12 Fedora Update System 2017-02-09 04:21:33 UTC
mariadb-10.1.21-1.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2017-02-09 20:49:59 UTC
mariadb-10.1.21-1.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.