Can't change MySQL password with mysqladmin

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Can't change MySQL password with mysqladmin

Postby needshelp » 06. December 2019 00:46

I may be missing something obvious, because I am just getting started again with XAMPP after a hiatus of 10 years ...

Anyhow, the XAMPP readme file says I can change the MySQL password with:
C:\xampp\mysql\bin\mysqladmin.exe -u root -p secret

When I tried, I was asked to enter a password. I tried: nothing
(because supposedly there is no root password) and get this error message:

C:\xampp\mysql\bin\mysqladmin.exe: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'

I then tried some of the usual suspects: e.g. password and get this error message:

C:\xampp\mysql\bin\mysqladmin.exe: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'

Installation:
XAMPP 7.3.11 full install with xampp-windows-x64-7.3.11-0-VC15-installer.exe
Windows 10 Pro 64bit
Install path: C:\xampp\

xampp-control.log
2:22:28 PM [main] Initializing Modules
2:22:28 PM [main] Starting Check-Timer
2:22:28 PM [main] Control Panel Ready
2:22:32 PM [Apache] Attempting to start Apache app...
2:22:32 PM [Apache] Status change detected: running
2:22:35 PM [mysql] Attempting to start MySQL app...
2:22:35 PM [mysql] Status change detected: running
2:43:29 PM [mysql] Attempting to stop MySQL app...
2:43:29 PM [mysql] Status change detected: stopped
2:43:32 PM [Apache] Attempting to stop Apache (PID: 7924)
2:43:32 PM [Apache] Attempting to stop Apache (PID: 9520)
2:43:32 PM [Apache] Status change detected: stopped
2:43:37 PM [Apache] Attempting to start Apache app...
2:43:37 PM [Apache] Status change detected: running
2:43:40 PM [mysql] Attempting to start MySQL app...
2:43:40 PM [mysql] Status change detected: running
2:44:08 PM [mysql] Attempting to stop MySQL app...
2:44:08 PM [mysql] Status change detected: stopped
2:44:10 PM [Apache] Attempting to stop Apache (PID: 9772)
2:44:10 PM [Apache] Attempting to stop Apache (PID: 5680)
2:44:10 PM [Apache] Status change detected: stopped
2:44:33 PM [main] Deinitializing Modules
2:44:33 PM [main] Deinitializing Control Panel

mysql_error.log
2019-12-05 15:41:25 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2019-12-05 15:41:25 0 [Note] InnoDB: Uses event mutexes
2019-12-05 15:41:25 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2019-12-05 15:41:25 0 [Note] InnoDB: Number of pools: 1
2019-12-05 15:41:25 0 [Note] InnoDB: Using SSE2 crc32 instructions
2019-12-05 15:41:25 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2019-12-05 15:41:25 0 [Note] InnoDB: Completed initialization of buffer pool
2019-12-05 15:41:25 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=302060
2019-12-05 15:41:25 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2019-12-05 15:41:25 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2019-12-05 15:41:25 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2019-12-05 15:41:25 0 [Note] InnoDB: Setting file 'C:\xampp\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2019-12-05 15:41:25 0 [Note] InnoDB: File 'C:\xampp\mysql\data\ibtmp1' size is now 12 MB.
2019-12-05 15:41:25 0 [Note] InnoDB: Waiting for purge to start
2019-12-05 15:41:25 0 [Note] InnoDB: 10.4.8 started; log sequence number 302069; transaction id 209
2019-12-05 15:41:25 0 [Note] Plugin 'FEEDBACK' is disabled.
2019-12-05 15:41:25 0 [Note] InnoDB: Loading buffer pool(s) from C:\xampp\mysql\data\ib_buffer_pool
2019-12-05 15:41:25 0 [Note] Server socket created on IP: '::'.
needshelp
 
Posts: 5
Joined: 05. December 2019 18:00
XAMPP version: 7.3.11
Operating System: Windows 10 Pro

Re: Can't change MySQL password with mysqladmin

Postby needshelp » 06. December 2019 17:40

I've made progress of a sort ...

I editted the my.ini file to add a password. Now, when I run:
mysqladmin -u root -p secret22

and am asked for the password, I used the one in my.ini & I got a very different error message:
C:\xampp\mysql\bin\mysqladmin.exe: Unknown command: 'secret22'

So, I now need to figure out the syntax for mysqladmin for changing the password ... I found different things, so realized I needed to check the mysql version. When I run mysql --version, I get:
mysql Ver 15.1 Distrib 10.4.8-MariaDB, for Win64 (AMD64), source revision 4c2464b87d58a43d1292e166bae6720b51f4b000

WHen I Google for mysql 15.1, I find NOTHING. When I go to https://dev.mysql.com/doc, it only talks about mysql 8.0 ...

I am totally lost; please, someone, put me out of my misery
Last edited by needshelp on 06. December 2019 18:14, edited 1 time in total.
needshelp
 
Posts: 5
Joined: 05. December 2019 18:00
XAMPP version: 7.3.11
Operating System: Windows 10 Pro

Re: Can't change MySQL password with mysqladmin

Postby Altrea » 06. December 2019 17:55

Remove the whitespace between -p and the password. It has to be without whitespace.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11933
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Can't change MySQL password with mysqladmin

Postby needshelp » 06. December 2019 18:20

Thanks

I just tried that & just get the same output as mysqladmin help ...

This happens whether or not I have a password set in my.ini

Knowing what mysql version I really do have & where to find accurate documentation would help me greatly
Last edited by needshelp on 06. December 2019 18:32, edited 1 time in total.
needshelp
 
Posts: 5
Joined: 05. December 2019 18:00
XAMPP version: 7.3.11
Operating System: Windows 10 Pro

Re: Can't change MySQL password with mysqladmin

Postby Altrea » 06. December 2019 18:28

MariaDB 10.4.8 is the DBMS and version.
XAMPP includes MariaDB instead of MySQL
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11933
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Can't change MySQL password with mysqladmin

Postby needshelp » 06. December 2019 19:01

I'm still stuck changing the password - or doing anything with mysqladmin ...
needshelp
 
Posts: 5
Joined: 05. December 2019 18:00
XAMPP version: 7.3.11
Operating System: Windows 10 Pro

Re: Can't change MySQL password with mysqladmin

Postby needshelp » 06. December 2019 20:12

ALso, MariaDB says it uses mysql command line, so it would help me if I could look up documentation for that and it would be helpful to know what version to look for. I would have thought that's what mysql --version does, and, as I said, it says version 15.1, which doesn't seem right.
needshelp
 
Posts: 5
Joined: 05. December 2019 18:00
XAMPP version: 7.3.11
Operating System: Windows 10 Pro

Re: Can't change MySQL password with mysqladmin

Postby Nobbie » 06. December 2019 20:28

Why dont you use phpmyadmin instead of (not working) mysqladmin? On my linux system mysqladmin also does not work, it behaves exactly as yours, only shows up with full help. But phpmyadmin is running fine via http://localhost/phpymadmin
Nobbie
 
Posts: 13176
Joined: 09. March 2008 13:04

Re: Can't change MySQL password with mysqladmin

Postby Altrea » 06. December 2019 21:51

needshelp wrote:ALso, MariaDB says it uses mysql command line, so it would help me if I could look up documentation for that and it would be helpful to know what version to look for. I would have thought that's what mysql --version does, and, as I said, it says version 15.1, which doesn't seem right.

15.1 is the version number of the command line interface.

As related to the MariaDB documentation for mysqladmin you need to specify a command (required). -u and -p are only options, this is not an alternative for a command.
There is a command "password" which sets a new password. This command can be omitted if there is no command following, but seems to be not working if there is no command given at all.
So the correct command for setting the root password for the first time would be
Code: Select all
mysqladmin -u root password "yournewpassword"
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11933
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Can't change MySQL password with mysqladmin

Postby lostintranslation » 22. January 2020 11:53

I'm having the same problem.
I have done a fresh install of XAMPP 7.41 to my Windows 10 x64 OS
It all ran fine and I can access phpmyadmin

I then wanted to install Wordpress from Bitnami
Wordpress doesn't accept the MySQL root password being blank, which is how XAMPP is when first installed.

I read in the local copy of faqs (localhost/dashboard/faq.html ) the following:

If you want have your XAMPP accessible from the internet, you should go to the following URI which can fix some problems:
http://localhost/security/
With the security console you can set a password for the MySQL user "root" and phpMyAdmin. You can also enable a authentication for the XAMPP demopages.


BUT there is no such URI !

I have looked elsewhere for a solution and found the one in this thread ie

Code: Select all
C:\xampp\mysql\bin>mysqladmin -u root password


but , as previously reported, I get the following response:

Code: Select all
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'


It seems a very basic issue which others must have overcome. How to install Wordpress on a Windows version of Xampp ?
lostintranslation
 
Posts: 1
Joined: 22. January 2020 11:34
XAMPP version: 7.4.1
Operating System: Window 10 x64

Re: Can't change MySQL password with mysqladmin

Postby Altrea » 22. January 2020 14:10

For setting a password with mysqladmin you need to use this command
Code: Select all
mysqladmin -u root password "yournewpassword"


The parameter "password" is a command, so it must be the word password, not any user choosed word for an old or new password.

So for example the command can look like this to set a password for the very first time
Code: Select all
mysqladmin -u root password "test"
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11933
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 279 guests