therecluse26 / PHP-Login

A login system built with PHP, MySQL, jQuery and Bootstrap
MIT License
839 stars 444 forks source link

Solution to authentication problem MySQL 8 #223

Open samuelsylvander opened 5 years ago

samuelsylvander commented 5 years ago

I had problems installing the package on my Mojave machine with MySQL 8 due to new authentication model.

Solved it by doing the following:

  1. Edited the my. file and added the following: [mysqld] default-authentication-plugin=mysql_native_password

  2. Run the following commands in MySQL CREATE USER 'admin'@'localhost' IDENTIFIED WITH mysql_native_password BY 'yourpass'; GRANT ALL PRIVILEGES ON . TO 'admin'@'localhost' WITH GRANT OPTION; CREATE USER 'admin'@'%' IDENTIFIED WITH mysql_native_password BY 'yourpass'; GRANT ALL PRIVILEGES ON . TO 'admin'@'%' WITH GRANT OPTION; # CREATE DATABASE IF NOT EXISTS yourdb COLLATE 'utf8_general_ci' ; GRANT ALL ON yourdb.* TO 'admin'@'%' ; FLUSH PRIVILEGES ;

  3. Re-Started MySQL

  4. Run the installer

Reason bug: Default authenticate of MySQL 8.0.4 changed. Refer to detail information: https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-4.html at Security Notes