Laravel Execute migrate command prompt: No such file or directory resolution, laravelmigrate
This example describes the Laravel execution migrate command prompt: No such file or directory workaround. Share to everyone for your reference, as follows:
Use the Laravel command line tool today to operate the database migration operation times wrong, prompt MySQL 2002 error,
View database Configuration Yes, the website front desk can also open, explain can connect, that is what reason?
In Laravel5, there are two ways to solve the problem:
1. Add a Database configuration item
' MySQL ' = [ ' driver ' = ' mysql ', ' host ' = ' env ' (' db_host ', ' localhost '), ' database ' = > env (' db_database ', ' Forge '), ' username ' = env (' db_username ', ' Forge '), ' password ' = env (' Db_ PASSWORD ', '), ' charset ' = ' utf8 ', ' collation ' = ' utf8_general_ci ', ' unix_socket ' = > '/applications/mamp/tmp/mysql/mysql.sock ', ' prefix ' = ' laravel_ ', ' strict ' = False,],
One of the additions here is unix_socket, native Mac-mounted MAMP environment, path is/applications/mamp/tmp/mysql/mysql.sock, the way to view your own path is to enter the following command in MySQL to see:
Show variables like '%sock% ';
As shown in the following:
2. Modify the. Env Configuration
This method can only be modified temporarily, let migrate can execute, then must change back.
Temporary modification method is to change the db_host there to localhost:8889, that is, the port number plus, and then use the Laravel5 Artisan command to perform the migrate operation can be, but the operation is done to change back to the previous wording, Otherwise the site front page will not open to the database, prompt error: sqlstate[hy000]  Unknown MySQL Server Host ' localhost:8889 ' (0)
Well, this solves the problem of using Laravel5 's migrate error.
Turn from: Small Talk blog Http://www.tantengvip.com/2015/12/laravel-migrate-mysql-2000/
More interested in laravel related content readers can view this site topic: "Laravel Framework Introductory and Advanced tutorial", "PHP Excellent Development Framework Summary", "Smarty Template Primer Basic Tutorial", "PHP date and Time usage summary", "PHP object-oriented Programming introduction tutorial "," PHP String Usage Summary "," Introduction to Php+mysql Database Operations "and" PHP common database Operation Skills Summary "
It is hoped that this article is helpful to the PHP program design based on Laravel framework.
Articles you may be interested in:
- PHP's Laravel framework combined with MySQL and Redis database deployment
- Methods for using Message Queuing queue and asynchronous queues in PHP's Laravel framework
- A detailed example of trait usage in Laravel
- Steps to register facades in Laravel
- Laravel method of implementing automatic dependency injection of constructors
- Laravel ways to reduce database query pressure using caching cache data
- Create an App interface (API) based on Laravel
- Eloquent Object relational mapping in PHP's Laravel framework using
- Laravel Framework Database curd operation and coherent operation summary
- In-depth parsing of event events operations in PHP's Laravel framework
http://www.bkjia.com/PHPjc/1111344.html www.bkjia.com true http://www.bkjia.com/PHPjc/1111344.html techarticle laravel Execute migrate command prompt: No such file or directory workaround, Laravelmigrate This example describes laravel Execute migrate command prompt: No such file or Directory resolution ...