Skip to content

Instantly share code, notes, and snippets.

@Bazsmagister
Created February 28, 2020 08:07
Show Gist options
  • Save Bazsmagister/ee1d92fd2202262222b468d563b11c59 to your computer and use it in GitHub Desktop.
Save Bazsmagister/ee1d92fd2202262222b468d563b11c59 to your computer and use it in GitHub Desktop.
MySQL on linux in case of some problems
Login as root first:
$ sudo mysql -u root
Then CREATE or ALTER a non-root user (use '127.0.0.1' instead of 'localhost' if needed):
CREATE USER 'admin'@'localhost' IDENTIFIED BY 'adminspassword';
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost';
FLUSH PRIVILEGES;
Exit and restart:
exit
$sudo service mysql restart
$sudo service apache2 restart
And edit the .env file:
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3630 //not sure
DB_DATABASE=yourdbname
DB_USERNAME=admin
DB_PASSWORD=adminspassword
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment