File: mysql_secure_installation-remove-root-pw-creation.patch

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (30 lines) | stat: -rw-r--r-- 1,543 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Description: Remove the creation of a root password in mysql_secure_installation
 Since Ubuntu and Debian use the auth_socket plugin for the root user by default,
 and attempting to set a password for it through "SET_PASSWORD" causes an error,
 do not create a root password in the mysql_secure_installation script if one
 has not been set previously. If the user would like to instead use a password
 they can run
 ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by 'password';
 in the mysql client.
Author: Lena Voytek <lena.voytek@canonical.com>
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/mysql-8.0/+bug/1980466
Forwarded: no
Last-Update: 2023-04-20
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/client/mysql_secure_installation.cc
+++ b/client/mysql_secure_installation.cc
@@ -811,8 +811,11 @@
   }
 
   if (!hadpass) {
-    fprintf(stdout, "Please set the password for %s here.\n", opt_user);
-    set_opt_user_password(component_set);
+    fprintf(stdout,
+            "\nSkipping password set for %s as authentication with auth_socket is used by default.\n"
+            "If you would like to use password authentication instead, this can be done with the \"ALTER_USER\" command.\n"
+            "See https://dev.mysql.com/doc/refman/8.0/en/alter-user.html#alter-user-password-management for more information.\n\n"
+            , opt_user);
   } else if (opt_use_default == false) {
     char prompt[256];
     fprintf(stdout, "Using existing password for %s.\n", opt_user);