当前正在迁移到mac OSX,我想在我的laravel网站上使用代客泊车服务。所以这是我卡住的地方:
在安装自制软件,PHP和valet所需的其余要求之后,到终端时,无法访问数据库。
起初,我有这个:
Sydney-de-Sousas-Mac:~ sidney$ mysql -uroot
mysql: Can't read dir of '/usr/local/etc/my.cnf.d' (OS errno 2 - No such file or directory)
mysql: [ERROR] Fatal error in defaults handling. Program aborted!
Sydney-de-Sousas-Mac:~ sidney$ mysql server start
mysql: Can't read dir of '/usr/local/etc/my.cnf.d' (OS errno 2 - No such file or directory)
mysql: [ERROR] Fatal error in defaults handling. Program aborted!
Sydney-de-Sousas-Mac:~ sidney$ mysql
mysql: Can't read dir of '/usr/local/etc/my.cnf.d' (OS errno 2 - No such file or directory)
mysql: [ERROR] Fatal error in defaults handling. Program aborted!
然后我创建了它请求的文件:
Sydney-de-Sousas-Mac:~ sidney$ mkdir /usr/local/etc/my.cnf.d
但是当我尝试访问数据库时,访问被拒绝
Sydney-de-Sousas-Mac:~ sidney$ mysql -uroot
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
Sydney-de-Sousas-Mac:~ sidney$ mysql -uroot -p
Enter password:
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
我认为默认情况下密码为空字符串。
如何访问我的数据库?