Help: Create database, access denied root
0528Makoto opened this issue · comments
when trying to create a database
use larasail database init --force
Additional context
larasail@mywebsite:~$ larasail database init --force
Please enter database user to create [larasail]: mywebsite
Please enter database name to create [larasail]: mywebsite
WARNING: This will remove existing database and user!
Are you sure? [y/N] y
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
ERROR: Unable to create database 'mywebsite' (possible duplicate)
INFO: You can force new database creation with the same name by using --force flag
Hey @DevMakoto. Are you running Mysql or MariaDB?
@SamuelMwangiW install mariadb
with larasail setup mariadb php80
I suspect the issue is caused by MariaDB using the unix_socket plugin for root by default. Kindly try running sudo mysql
using the larasail
user (I.e after larasail enter
).
Once in the mysql shell, run the query below:
ALTER USER root@localhost IDENTIFIED VIA mysql_native_password;
I will PR a fix
Thx