Skip to content

Instantly share code, notes, and snippets.

@ctjhoa
Created September 23, 2020 23:00
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ctjhoa/127244335a1dc13100214f6076c8480e to your computer and use it in GitHub Desktop.
Save ctjhoa/127244335a1dc13100214f6076c8480e to your computer and use it in GitHub Desktop.
Install percona without password archlinux

Install percona on archlinux without root password

Install packages

$ pacman -S percona-server-clients percona-server

Start mysql & connect

$ systemctl start mysql
$ sudo grep 'temporary password' /var/log/mysqld.log 
$ mysql -uroot -p

Alter password

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'Passw0rd!';

Alter global variables

mysql> SHOW VARIABLES LIKE 'validate_password%';
+--------------------------------------+--------+
| Variable_name                        | Value  |
+--------------------------------------+--------+
| validate_password.check_user_name    | ON     |
| validate_password.dictionary_file    |        |
| validate_password.length             | 8      |
| validate_password.mixed_case_count   | 1      |
| validate_password.number_count       | 1      |
| validate_password.policy             | MEDIUM |
| validate_password.special_char_count | 1      |
+--------------------------------------+--------+

mysql> SET GLOBAL validate_password.special_char_count = 0;
mysql> SET GLOBAL validate_password.mixed_case_count = 0;
mysql> SET GLOBAL validate_password.policy = 0;
mysql> SET GLOBAL validate_password.number_count = 0;
mysql> SET GLOBAL validate_password.length = 0;

mysql> SHOW VARIABLES LIKE 'validate_password%';
+--------------------------------------+-------+
| Variable_name                        | Value |
+--------------------------------------+-------+
| validate_password.check_user_name    | ON    |
| validate_password.dictionary_file    |       |
| validate_password.length             | 0     |
| validate_password.mixed_case_count   | 0     |
| validate_password.number_count       | 0     |
| validate_password.policy             | LOW   |
| validate_password.special_char_count | 0     |
+--------------------------------------+-------+

Remove password

mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password;
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '';
@prirai
Copy link

prirai commented Aug 17, 2023

Thanks a lot! I was getting into some errors regarding permissions but this one helped me out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment