I'm using PHP 7.1, MySQL 5.7, and Laravel 5.7.12. And on a Mac.
I'm new to Laravel. I'm building my application on a remote server (a Cloudways Server). I know most people build their project locally and then deploy their application onto a remote server, but I'm just building my application on a live remote server and I'm using SFTP.
I've configured my .env file to reflect my server's connection details.
When I try to run php artisan migrate I get this error:
Illuminate\Database\QueryException : SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schema.tables where table_schema = ********* and table_name = migrations)
at /Users/newadmin/Documents/Sites/Quipper/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664
660| // If an exception occurs when attempting to run a query, we'll format the error
661| // message to include the bindings with SQL, which will make this exception a
662| // lot more helpful to the developer instead of just the database's errors.
663| catch (Exception $e) {
> 664| throw new QueryException(
665| $query, $this->prepareBindings($bindings), $e
666| );
667| }
668|
Exception trace:
1 PDOException::("SQLSTATE[HY000] [2002] No such file or directory")
/Users/newadmin/Documents/Sites/Quipper/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:70
2 PDO::__construct("mysql:host=localhost;dbname=*********", "*********", "**********", [])
/Users/newadmin/Documents/Sites/Quipper/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:70
Above I've placed ********** where my database name, username and password go, I guess just for security reasons.
I think it's worth noting on that second exception trace it says "mysql:host=localhost;", when in my .env file I have put in my DB_HOST address, which is a remote server address. So it shouldn't be saying localhost. That seems like it could be part of the problem?
Any help would be greatly appreciated!
I've already tried running in my terminal:
php artisan cache:clear php artisan config:cache
And that didn't work.