Challenge: How To Check Status of MySQL on Centos

dhtmldhtml Posts: 1,019

I needed to run this command without putting password on the shell:

$ mysqladmin status -u root

This displays the status of mysql by the way.

The challenge was that the root user has a password. To remove it on phpmyadmin was throwing something about : Your password does not satisfy the current policy requirements.

So i logged in on the console and did this:

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   |

+--------------------------------------+--------+

7 rows in set (0.01 sec)


# whereis my.cnf

my: /etc/my.cnf

sudo nano /etc/my.cnf and did this:

[mysqld]

default_authentication_plugin=mysql_native_password


validate_password.check_user_name = off

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


Saved, and came back to fire:

# sudo service mysqld restart

Went back to check this:

mysql> SHOW VARIABLES LIKE 'validate_password%';

+--------------------------------------+-------+

| Variable_name            | Value |

+--------------------------------------+-------+

| validate_password.check_user_name  | OFF  |

| 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   |

+--------------------------------------+-------+

7 rows in set (0.01 sec)


And well, I could change my password easily following that.

Sign In or Register to comment.