Problem running Migrations on Laravel

Asked

Viewed 1,155 times

1

I am trying to run the Migrations on the Windows and bumped into the following error, do not know if and connection to the database what can be

Illuminate\Database\QueryException  : SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution (SQL: select * from information_schema.tables where table_schema = mensis and table_name = migrations and table_type = 'BASE TABLE')

 at /var/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php:665
    661|         // If an exception occurs when attempting to run a query, we'll format the error
    662|         // message to include the bindings with SQL, which will make this exception a
    663|         // lot more helpful to the developer instead of just the database's errors.
    664|         catch (Exception $e) {
 > 665|             throw new QueryException(
    666|                 $query, $this->prepareBindings($bindings), $e
    667|             );
    668|         }
    669| 

 Exception trace:

  1   PDOException::("PDO::__construct(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution")
      /var/www/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:70

 2   PDO::__construct("mysql:host=mysql;port=3306;dbname=mensis", "mensis", "mensis", [])
      /var/www/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:70

 Please use the argument -v to see more details.

.env

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=aqbanc
DB_USERNAME=root
DB_PASSWORD=

1 answer

6


In the DB_HOST is the address configuration to get to the server and you put mysql is wrong, or is localhost(127.0.0.1) (which is the local machine) or a valid address, so where is your server , an example with localhost:

DB_CONNECTION=mysql
DB_HOST=localhost 
DB_PORT=3306
DB_DATABASE=mensis
DB_USERNAME=mensis
DB_PASSWORD=mensis
  • Poise My configuration is all right and will not in case I’m using xampp on linux and even downloading a new application Able does not run migrate.

  • 1

    Did you set the configuration correctly? @Richardcarlos you read my solution and put localhost or IP address?

  • 1

    Remember to execute the php artisan config:cache after changing the . env.

  • if your bank is on a virtual machine that happens to be called "mysql" check for remote permission.

  • @VirgilioNovic Minha configuração e essa: 
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=aqbanc
DB_USERNAME=root
DB_PASSWORD=

  • @Richardcarlos the DB_PASSWORD is blank? and your programming machine is the same as the bank’s?

  • It’s because I’m using shampoos

  • Here’s what I’d do Xampp and create a password for the user root and that problem will end. @Richardcarlos or even a user with privileges for the bank.

  • And how do I do it in shaman? Sorry for my ignorance I had never done it before @Virgilionovic.

  • https://tekzoom.com.br/como-alterar-a-senha-do-mysql-xampp-e-do-phpmyadmin/ @Richardcarlos use this link

Show 5 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.