Mysql 5.7 Root เข้าระบบไม่ได้ และไม่สามารถใช้ Remote ได้ มีวิธีแก้

ที่ หน้า Terminal
#mysql_secure_installation
แล้วสร้าง Password ให้กับ Root ใหม่
หรือ
----------------------------------

sudo service mysql stop
sudo mysqld_safe --skip-grant-tables &

mysql -u root mysql

UPDATE mysql.user SET authentication_string=PASSWORD('mypassword') WHERE User='root';
UPDATE mysql.user SET plugin="mysql_native_password" WHERE User='root';
FLUSH PRIVILEGES;

กรณีสร้าง User ไม่ได้ลองตามนี้

SHOW VARIABLES LIKE 'validate_password%';
The output should be something like that :
+--------------------------------------+-------+
| Variable_name                        | Value |
+--------------------------------------+-------+
| validate_password.check_user_name    | ON    |
| validate_password.dictionary_file    |       |
| validate_password.length             | 6     |
| validate_password.mixed_case_count   | 1     |
| validate_password.number_count       | 1     |
| validate_password.policy             | LOW   |
| validate_password.special_char_count | 1     |
+--------------------------------------+-------+
then you can set the password policy level lower, for example:
SET GLOBAL validate_password.length = 6;
SET GLOBAL validate_password.number_count = 0;
 ----------------------------------
ส่วนกรณีไม่สามารถ Remote ได้
ให้แก้ไข File
# vi /usr/local/etc/mysql/my.cnf
ตรงบรรทัด
bind-address = 127.0.0.1