Posted on January 9, 2021 at 1:40 pm
On older MySQL versions you could use:
/etc/mysql/debian.cnf |
To get MySQL username and password to use for backup purposes.
On newer MySQL v8+ versions you just need to run this command as root user:
mysql -u root -h localhost ... |
Password is not required in this case.
This is because it uses unix_socket authentication as explained here:
https://www.percona.com/blog/2019/11/01/use-mysql-without-a-password/
To allow another Linux user to auto-connect to MySQL with full privileges:
GRANT ALL PRIVILEGES ON *.* TO 'vagrant'@'localhost' IDENTIFIED VIA unix_socket; |
This works also on recent MariaDB versions.
Other Posts
- Set OpenVPN to Listed on a Specific IP Address
- Bash Trim Leading and Trailing Whitespace from a String
- Bash Get Name of Ethernet Network Interface
- VPN Providers with Dedicated Static IP Address
- OpenVPN Iptables Rules
- WireGuard VPN Iptables Rules
- How to Install WireGuard VPN in Debian 10 Buster
- Bash: No space left on device (inodes issue)
Updated Posts
- Add Desktop shortcut for all Windows PC users
- How to pass custom command-lien parameters in InnoSetup
- Programmatically create desktop icon with InnoSetup
- GeneratePress - a Lightweight WordPress Theme 2021
- InnoSetup disable DesktopIcon via command-line
- Use cURL to authenticate with JWT Bearer tokens
- Detect VMWare Virtual Machine
- Detect Microsoft Virtual PC Virtual Machine