[MDEV-29712] Cannot Reset MariaDB Root password Created: 2022-10-05 Updated: 2022-10-11 Resolved: 2022-10-11 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | N/A |
| Affects Version/s: | 10.8 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Mike Jacobs | Assignee: | Unassigned |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | authentication, root | ||
| Environment: |
win 10 pro 21H2 on i9 with 32gb RAM & 2x2TB ssds |
||
| Description |
|
Somehow I've buggered up my password into the MariaDB database I was last working in back in August when I described a potential auto increment bug, So I'm trying to reset the password following the instructions I found here: but it fails at my attempt to login as root. The command window script shows the full sequence: ***************************** C:\Program Files\MariaDB 10.8\bin>mysqld --skip-grant-tables --skip-networking --shared-memory C:\Program Files\MariaDB 10.8\bin>mysql -u root [my comment: I've seen this error many time before and its always been because the MariaDB service hasn't started, so I start it manually thus:] C:\Program Files\MariaDB 10.8\bin>net start mariadb C:\Program Files\MariaDB 10.8\bin>mysql -u root ***************************** obviously, at that point I can't go any further, so I'm out of options. What am I missing? |
| Comments |
| Comment by Mike Jacobs [ 2022-10-05 ] | |||||||
|
little bit extra: just retried the mysqld command and, using Process Hacker, went looking for the PID it claims to be starting. Nothing appears. And, unlike the net stop or net start commands, as you can see from the command window sequence, no confirmation is displayed, so it looks like the mysqld command is failing but I've no idea how to troubleshoot that... | |||||||
| Comment by Vladislav Vaintroub [ 2022-10-05 ] | |||||||
|
The tutorial that you're following, it is simply incorrect a) --shared-memory does not exist in MariaDB since IIRC 10.3. The server thus can not start, but you do not see that , because the failed startup messages are in the error log, not on the console. The failed startup that you do not see, would end up with
b) If you do not like the server to be exposed on the internet and limit to local machine only, add --bind-address=127.0.0.1 parameter. c) Do not use --skip-networking The full technology demonstration. 1. From elevated command prompt
Make sure server starts, if it does, it writes something like
on the console. If it does not start, maybe you need to add "--defaults-file=C:\path\to\datadir\my.ini" to wherever the my.ini is 2. Set password and shutdown server from another cmd window, or powershell, or whatever, execute
with your new password instead of my_secret in IDENTIFIED BY This batch command will also stop the server you started previously. 3. restart the service, and connect with the new password | |||||||
| Comment by Mike Jacobs [ 2022-10-06 ] | |||||||
|
Thanks Vadislav Looks like a comprehensive reply. (Don't know if there's a bug in the message system, but I got 6 copies of your message, although I noticed that the last one was an edit, so probably legit) The first part worked. Your version on the mysqld.exe command started the server and I got the kind of response you suggested. However, the second part (in a new elevated cmd window) still failed like the original Here's the exact script with a dummy password I generated for the purpose of this reply: C:\Program Files\MariaDB 10.8\bin>mysql.exe -uroot -e "flush privileges; ALTER USER 'root'@'localhost' IDENTIFIED BY 'XRs8SSixKmowSMsWcLL8wui6p';flush privileges;shutdown" I also tried inserting a space in "-uroot" as, in all other command lines I've seen (and used) it has appeared as -u root but that made no difference. | |||||||
| Comment by Mike Jacobs [ 2022-10-07 ] | |||||||
|
OK, this just got weird. It does NOT appear to be a password issue at all I just discovered that if I use the following mysql.exe --user=root --password it prompts me for the password, I paste in the password. It lets me in. But if I use mysql.exe --user=root --password=the same password I just pasted in above I get the Access denied message. Anyone come across that behaviour before? Anyone got any ideas as to probable cause and possible fix? | |||||||
| Comment by Mike Jacobs [ 2022-10-11 ] | |||||||
|
Fixed, eventually, by uninstalling and reinstalling (and taking opportunity to step up to 10.9.3). The cause was almost certainly a reserved character in the password (probably the % symbol) which Maria can handle but the windoze command line couldn't. First issue I've "closed" in this forum. Not obvious how I mark it as such. |