I currently use the following but it ALWAYS prompts me to manually type the password. Is there any way to pass it in on the command line when launching the executable?
mysqladmin processlist -u root -p
I currently use the following but it ALWAYS prompts me to manually type the password. Is there any way to pass it in on the command line when launching the executable?
mysqladmin processlist -u root -p
Just found out the answer....
mysqladmin processlist -u root -pYOURPASSWORDHERE
No space between your password and the -p
-p'YOURPASSWORD HERE'
–
Genocide -h localhost
and -u root
but not -pPASSWORD
. Classic programmers making everything harder than necessary. –
Bogey -uroot
works fine –
Panta processlist
? –
Armillary "password"
. That's how powershell does it and it works quite well –
Bogey Try:
--password=PasswordTextHere
This should work: mysql -uroot -p'password'
If you're trying to automate mysql solution, you can use password from variable:
mysql_pass=$(sudo grep -oP "temporary password is generated for root@localhost: \K(.*)" /var/log/mysqld.log)
mysql -uroot -p"$mysql_pass" < somescript.sql
© 2022 - 2024 — McMap. All rights reserved.
export MYSQL_PWD=muhpassword
) and execute your command without the-p
. See MySQL Program Environment Variables. In spite of the manual's dire warnings, this is rather safe. Unless you start weird warez in the same shell that might hoover your environment and send it off to darkaspirator.cc. – Haviland