[MDEV-7657] mysql_secure_installation does not work with non-default socket file location Created: 2015-03-04  Updated: 2021-09-11

Status: Open
Project: MariaDB Server
Component/s: Admin statements
Affects Version/s: 10.0.17, 10.0
Fix Version/s: 10.1

Type: Bug Priority: Minor
Reporter: Jonathan Nicol Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: upstream-fixed, verified
Environment:

Debian Linux 7.8 x86_64


Issue Links:
PartOf
is part of MDEV-26593 Replace mysql_secure_installation wit... Open

 Description   

mysql_secure_installation fails when server is compiled/installed with non-default socket location. It also does not accept any flags pointing it in the right direction.
See: http://bugs.mysql.com/bug.php?id=46842

Example:

dbuser@dbhost:~$ cat .my.cnf 
[client]
user = root
#password = <fill me in>
host = 127.0.0.1
port = 3323

dbuser@dbhost:~$ /home/dbuser/mariadb-10.0.17/bin/mysql_secure_installation 
 
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!
 
In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
 
Enter current password for root (enter for none): 
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

dbuser@dbhost:~$ /home/dbuser/mariadb-10.0.17/bin/mysql_secure_installation --defaults-extra-file=~/.my.cnf
 
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!
 
In order to} log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
 
Enter current password for root (enter for none): 
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

dbuser@dbhost:~$ /home/dbuser/mariadb-10.0.17/bin/mysql_secure_installation --socket=~/mariadb-10.0.17/var/mysql.sock
 
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!
 
In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
 
Enter current password for root (enter for none): 
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
 



 Comments   
Comment by Elena Stepanova [ 2015-03-04 ]

Apparently it was fixed in 5.7.

Generated at Thu Feb 08 07:21:17 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.