Laravel xampp migrate missing driver windowns 10 - laravel

Windows 10, using xampp v3.2.4, Laravel 8.12. Whenever running php artisan migrate I get could not find driver (SQL: select * from information_schema.tables where table_schema = public and table_name = migrations and table_type = 'BASE TABLE').
I've tried just about every 'solution' on stack. I've updated the C:\xampp\php\php.ini file, by uncommenting extension=pdo_mysql and extension=mysqli plus setting extension_dir="C:/xampp/php/ext" with no luck.
I had no problems creating the database by logging into MySQL on the command line with mysql -u root and creating the database.
In the env file, `
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=testme
DB_USERNAME=root
DB_PASSWORD=
anddatabase.phpit's set to'default' => env('DB_CONNECTION', 'mysql'),` I'm out of solutions. Any help is much appreciated. The database shows on the PHPMyAdmin Dashboard.

After uninstalling Laravel, then reinstalling the migrate command is now working. Although I have no idea what caused it to now work correctly.

Related

Laravel SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: No such host is known

Before this project, I could not get this type of error. But at this time, I faced it.
composer require laravel/ui
php artisan ui:auth
.env
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=katherine_cleaners
DB_USERNAME=root
DB_PASSWORD=
After this,
php artisan migrate
Error
Illuminate\Database\QueryException
SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: No such host is known. (SQL: select * from information_schema.tables where table_schema = katherine_cleaners and table_name = migrations and table_type = 'BASE TABLE')
at F:\katherine\vendor\laravel\framework\src\Illuminate\Database\Connection.php:678
I tried following php artisan command: config:clear, cache:clear, key:generate. Also, I change the database name on MySQL and .env. And even, I deleted this project and create a new one. But this doesn't help me.
Does anyone know, how to figure out this error?
Your host in .env should be pointing to the IP of your database. Assuming your database is residing on the same server as your Laravel application, it should be:
DB_HOST=127.0.0.1

Laravel 5.5.6 backpack:base:install

I'm trying to install Backpack base using this comand: php artisan backpack:base:install
After few seconds I receive this error:
I tried to install backpack/generators manually but the problem is still the same.
Backpack can only be installed on an working Laravel instance. And it looks like your Laravel installation can't connect to the database. This usually happens:
A) when you haven't properly setup the .env file with your DB credentials; review your .env file; keep in mind you might also need to specify a db socket; by default homestead apps work with this db configuration:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=your_database_name
DB_USERNAME=homestead
DB_PASSWORD=secret
B) when you're running the command outside your homestead box; SSH into homestead first, then run the installation commands;
Hope it helps.
I tried all of your ideas but it still didn't work still, thanks for the suggestions. Anyways I just created a new project in laravel 5.5 and it did actually worked.

why .env file configuration in laravel is not working

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=
DB_USERNAME=root
DB_PASSWORD=
this is my configuration for laravel 5.4
but php artisan migrate is not working and have error
and the migrate error
Users-MacBook-Pro: ATP Developers php artisan migrate
In Connection.php line 664:
SQLSTATE[HY000] [1045] Access denied for user ''#'localhost' (using password: NO) (SQL: select * from information_schema.tables where table schema = atp_db and table_name = migrations)
In Connector.php line 87:
SQLSTATE[HY000] [1045] Access denied for user ''#'localhost' (using password: NO)
I faced a similar problem. So, I run the following commands as mentioned at
https://laracasts.com/discuss/channels/general-discussion/env-file-and-config-keys-not-updating-after-change,
php artisan cache:clear
php artisan config:clear
php artisan route:clear
Also, make sure to restart the server as well
php artisan serve
you should write these:
DB_DATABASE = your database name
DB_USERNAME = root
DB_PASSWORD = your password
and again run php artisan serve to make sure about saving .env and again run php artisan migrate
Indeed I had the same problem, I can not explain why Laravel indicates the old Host but the solution is to change the password.
Use below => php artisan config:cache
Change env host entry to DB_HOST=localhost. Or add the #'127.0.0.1' credentials to mysql.
The error indicates that you do not have the correct user and host combination in your database. The env file shows host is 127.0.0.1 but localhost is specified in the error. Add user#localhost entry to the database or user#% for wildcard.
This error would indicate that you don't have a database user configured in your .env file: ''#'localhost' . Your .env should have all those fields populated with the database name and credentials you configured before running any function that connects to the database.
Here are the preliminary steps to setup your database and .env file prior to running a php artisan migrate:
Hope it helps.
Step 1: Login to your mysql and create the database.
mysql -u root -p
create database just_brew_it;
Step 2: Although you can use root to authenticate via laravel, I'd create a new user to mitigate risk of any security issues:
GRANT ALL PRIVILEGES ON just_brew_it.* TO 'brew_user'#'%' identified by 'pint0fStell#' WITH GRANT OPTION;
FLUSH privileges;
Step 3: Modify your .env with the appropriate database, username and password
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE= just_brew_it
DB_USERNAME= brew_user
DB_PASSWORD= pint0fStell#
This combo worked for me:
php artisan clear-compiled
composer dump-autoload
php artisan optimize
I had the same issue and i couldnt run "config:cache" artisan command even with Artisan::call('config:cache');
so i done this and solved my issue:
artisan config:cache caches all files from /config into a single array that it stores. It then reads all config variables from that array and ignores anything in .env or the /config files until you recache them. That's why it still works after deleting .env.
https://laravel.com/docs/5.6/configuration#configuration-caching
If you don't have ssh access to your live server, you'd just need to delete the bootstrap/cache/config.php file, which is the cache file config:cache generates.

migration of the databese laravel 5.3

I have this problem can anyone help me.
I create application using laravel 5.3 ,i build databse and configure the file .ENV and database.php
but when i execute the command of migration show me error as the screenshot show
Create databse in my phpmyadmin1
here when i execute the command of migration 2
Create database data in your phpmyadmin
You forgot to write DB_USERNAME = in your .env file.
In your case:
DB_CONNECTION = mysql
DB_HOST = localhost //or 127.0.0.1
DB_PORT=3306
DB_DATABASE = data
DB_USERNAME = root
DB_PASSWORD = your password ...
Whats ten problem??.
That values are in case laravel don't find anything in. Env. So change directly in the file. Env

AsgardCMS Installation Error: 'homestead.page__pages' doesn't exist

I've installed https://asgardcms.com/en onto a Laravel Homestead WM twice now and got the error shown below both times when I try open it in a browser.
QueryException in Connection.php line 636:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'homestead.page__pages' doesn't exist (SQL: select count(*) as aggregate from `page__pages`)
Screenshot on Imgur
I'm using the default MySQL database settings which are.
DB_HOST=localhost
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
Everthing seemed fine from the terminal as there no installation issues shown.
Any ideas on what is happening here?
This looks like a database setup issue. Did you ran the install command php artisan asgard:install ? This will guide you step by step to set the database up.

Resources