could not find driver - php

I moved my project from my old host to my new host
I tried some times but every time I tried, Laravel showed this error:
could not find driver (SQL: select * from orders where status not
in (PENDING, COMPLETED) and api_order_id is not null order by RAND() limit 15)
I'm sure I uploaded my database fully and the I put my database information correctly
So why this error appeared?
Config/database.php codes:
<?php
return [
/*
|--------------------------------------------------------------------------
| PDO Fetch Style
|--------------------------------------------------------------------------
|
| By default, database results will be returned as instances of the PHP
| stdClass object; however, you may desire to retrieve records in an
| array format for simplicity. Here you can tweak the fetch style.
|
*/
'fetch' => PDO::FETCH_OBJ,
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for all database work. Of course
| you may use many connections at once using the Database library.
|
*/
'default' => env('DB_CONNECTION', 'mysql'),
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple.
|
|
| All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
*/
'connections' => [
'sqlite' => [
'driver' => 'sqlite',
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => '',
],
'mysql' => [
'driver' => 'mysql',
'port' => env('DB_PORT', '3306'),
'host' => 'localhost',
'database' => 'my_db_name',
'username' => 'db_user',
'password' => 'db_pass',
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'strict' => true,
'engine' => null,
'modes' => [
'STRICT_TRANS_TABLES',
'NO_ZERO_IN_DATE',
'NO_ZERO_DATE',
'ERROR_FOR_DIVISION_BY_ZERO',
'NO_AUTO_CREATE_USER',
'NO_ENGINE_SUBSTITUTION'
]
],
'pgsql' => [
'driver' => 'pgsql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
'sslmode' => 'prefer',
],
],
/*
|--------------------------------------------------------------------------
| Migration Repository Table
|--------------------------------------------------------------------------
|
| This table keeps track of all the migrations that have already run for
| your application. Using this information, we can determine which of
| the migrations on disk haven't actually been run in the database.
|
*/
'migrations' => 'migrations',
/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer set of commands than a typical key-value systems
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
*/
'redis' => [
'cluster' => false,
'default' => [
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => 0,
],
],
'installed' => '1',
'transfer_mode' => '%transfer_mode%',
];
.env file codes:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=my_db_name
DB_USERNAME=db_user
DB_PASSWORD=db_pass

MySQL is the database and php uses extensions like pdo_mysql to connect PHP and MySQL. Firstly driver and extensions are different. Drivers are mysqlnd or mysqlnd whereas extensions are pdo_mysql or nd_pdo_mysql etc. First check if drivers are installed properly.
Steps to check fo extensions :
Check in phpinfo() if you see pdo_mysql is enabled.
Sometimes managed hosting(mostly ones with cpanel) have their sql extensions enabled by default. Check in phpinto for _mysql in php extensions section. Check if you see any other extension enabled like nd_pdo_mysql. If it's the case then you will notice a conflict. You need to disable it first and then attempt to enable the pdo_mysql again.
Restart your PHP service and you can try again if it works.

Related

How to connect to MySQL and SQL Server databases at once in Laravel 8 and PHP 8 for Linux

I have a Laravel web application running on a Nginx application server. The application has 2 database connections: one to a local MySQL database named picking_demo and another to a remote Microsoft SQL Server named db_picking_main.
The MySQL connection works fine and doesn't need to be changed.
At first, the application worked under Laravel 5 and PHP 7. For the SQL Server connection, the application used the library techscope/laravel-sqlserver and it worked well.
However, due to client's requirements, we had to migrate the application to the latest Laravel and PHP Versions (version 8 for each) and we must use Ubuntu as the operative system. Thus, techscope/laravel-sqlserver is not compatible anymore and it had to be deleted from composer.json.
We are currently using the 20.04 version of Ubuntu.
At first, when we tested the connection from one of the application's commands that must work with the SQL Server connection, we got a "Driver not found" error.
After some research, I installed the following packages from the repositories: freetds-common, freetds-bin, php8.0-pdo-sybase. The package unixodbc was already installed when we started to work.
Also, I installed the ODBC Driver 17 for SQL Server following Microsoft's official instructions (see https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver15)
Afterwards, I tried executing the applicacion's command again and it gave me the following message:
In Connection.php line 685:
SQLSTATE[HY000] Unable to connect: Adaptive Server is unavailable or does not exist (10.0.50.8:1433) (severity 9) (SQL: sel
ect count(*) as aggregate from [deli_eti_correl] where [correl] > 1234891)
In Connector.php line 70:
SQLSTATE[HY000] Unable to connect: Adaptive Server is unavailable or does not exist (10.0.50.8:1433) (severity 9)
This is the content in config/database.php:
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for all database work. Of course
| you may use many connections at once using the Database library.
|
*/
'default' => env('DB_CONNECTION', 'mysql'),
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple.
|
|
| All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
*/
'connections' => [
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'geostore'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => true,
'engine' => null,
'options' => [
\PDO::ATTR_PERSISTENT => true
]
],
'todosport_dummy' => [
'driver' => 'mysql',
'host' => 'localhost',
'port' => '3306',
'database' => 'todosport_dummy',
'username' => 'root',
'password' => '',
'unix_socket' => '',
'charset' => 'utf8',
'collation' => 'utf8_spanish2_ci',
'prefix' => '',
'strict' => true,
'engine' => null,
'options' => [
\PDO::ATTR_PERSISTENT => true
]
],
'delisur_picking' => [
'driver' => 'sqlsrv',
'odbc_driver' => '{ODBC Driver 17 for SQL Server}',
'host' => '10.0.50.8',
'database' => 'bd_delisur_main',
'username' => 'sa',
'password' => 'Latorredebabel6427....D',
'port' => '1433',
'prefix' => '',
'charset' => 'utf8',
'collation' => 'utf8_spanish2_ci',
'TrustServerCertificate' => 'no',
'options' => [
\PDO::ATTR_PERSISTENT => true,
"MultipleActiveResultSets"=>'0',
"ConnectionPooling" => "1",
"TraceOn" => "0",
\PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"
]
]
],
/*
|--------------------------------------------------------------------------
| Migration Repository Table
|--------------------------------------------------------------------------
|
| This table keeps track of all the migrations that have already run for
| your application. Using this information, we can determine which of
| the migrations on disk haven't actually been run in the database.
|
*/
'migrations' => 'migrations',
/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer set of commands than a typical key-value systems
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
*/
'redis' => [
'client' => 'predis',
'default' => [
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => 0,
],
],
];
Questions:
Must I still configure TDS in order to connect to the desired database? If not, what steps are missing?
Is it possible that the cause is a permissions issue from the SQL Server Database server?
Thanks in advance
SOLVED
It wasn't a Laravel nor SQL Server nor tsql problem. It was a VPN problem. Recently my partner told me the application needs a VPN connection to the SQL Server database using openvpn. No additional configuracion is needed in tsql.
Thanks anyway.

SQLSTATE[HY000] [1045] Access denied for user in laravel

I want move a project from a host to my host.
but after the moving and change the .env file and config/database.php file, appeared this error:
SQLSTATE[HY000] [1045] Access denied for user 'test_root'#'mailserver63.mylittledatacenter.com' (using password: YES) (SQL: select * from orders where status not in (CANCELLED, COMPLETED) and api_order_id is not null order by RAND() limit 15)
this is config/database codes:
<?php
return [
/*
|--------------------------------------------------------------------------
| PDO Fetch Style
|--------------------------------------------------------------------------
|
| By default, database results will be returned as instances of the PHP
| stdClass object; however, you may desire to retrieve records in an
| array format for simplicity. Here you can tweak the fetch style.
|
*/
'fetch' => PDO::FETCH_OBJ,
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for all database work. Of course
| you may use many connections at once using the Database library.
|
*/
'default' => env('DB_CONNECTION', 'mysql'),
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple.
|
|
| All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
*/
'connections' => [
'sqlite' => [
'driver' => 'sqlite',
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => '',
],
'mysql' => [
'driver' => 'mysql',
'port' => env('DB_PORT', '3306'),
'host' => 'mysite.com',
'database' => 'test_root',
'username' => 'test_root',
'password' => 'rootpassword1234',
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'strict' => true,
'engine' => null,
'modes' => [
'STRICT_TRANS_TABLES',
'NO_ZERO_IN_DATE',
'NO_ZERO_DATE',
'ERROR_FOR_DIVISION_BY_ZERO',
'NO_AUTO_CREATE_USER',
'NO_ENGINE_SUBSTITUTION'
]
],
'pgsql' => [
'driver' => 'pgsql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
'sslmode' => 'prefer',
],
],
/*
|--------------------------------------------------------------------------
| Migration Repository Table
|--------------------------------------------------------------------------
|
| This table keeps track of all the migrations that have already run for
| your application. Using this information, we can determine which of
| the migrations on disk haven't actually been run in the database.
|
*/
'migrations' => 'migrations',
/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer set of commands than a typical key-value systems
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
*/
'redis' => [
'cluster' => false,
'default' => [
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => 0,
],
],
'installed' => '1',
'transfer_mode' => '%transfer_mode%',
];
I don't know what the connection with mailserver63.mylittledatacenter.com is and where is this phrase in my project.
I even used a tool to find mylittledatacenter phrase in my project files. Among my project files, I did not find any file software that came with that term.
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=database_name
DB_USERNAME=username
DB_PASSWORD=password
Three Steps to resolve this error or set the database in Laravel:
First add the database name (DB_DATABASE=database_name) in project .env file.
Then add the username of database (DB_USERNAME=username) in project .env file.
then add the password of the database (DB_PASSWORD=password) in project .env file.
Resolved this error following above steps SQLSTATE[HY000] [1045] Access denied for user in Laravel

Laravel not connected with mysql database

I am new in the laravel also in stackoverflow, I tried to configure database in my laravel application. but it is not working and always shows error to me. here is my database.php file.
database.php
<?php
return [
/*
|--------------------------------------------------------------------------
| PDO Fetch Style
|--------------------------------------------------------------------------
|
| By default, database results will be returned as instances of the PHP
| stdClass object; however, you may desire to retrieve records in an
| array format for simplicity. Here you can tweak the fetch style.
|
*/
'fetch' => PDO::FETCH_CLASS,
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for all database work. Of course
| you may use many connections at once using the Database library.
|
*/
'default' => 'mysql',
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple.
|
|
| All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
*/
'connections' => [
'sqlite' => [
'driver' => 'sqlite',
'database' => storage_path().'/database.sqlite',
'prefix' => '',
],
'mysql' => [
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'horsi',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
],
'pgsql' => [
'driver' => 'pgsql',
'host' => env('DB_HOST', 'localhost'),
'database' => env('DB_DATABASE', 'horsi'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
],
'sqlsrv' => [
'driver' => 'sqlsrv',
'host' => env('DB_HOST', 'localhost'),
'database' => env('DB_DATABASE', 'horsi'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'prefix' => '',
],
],
/*
|--------------------------------------------------------------------------
| Migration Repository Table
|--------------------------------------------------------------------------
|
| This table keeps track of all the migrations that have already run for
| your application. Using this information, we can determine which of
| the migrations on disk haven't actually been run in the database.
|
*/
'migrations' => 'migrations',
/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer set of commands than a typical key-value systems
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
*/
'redis' => [
'cluster' => false,
'default' => [
'host' => '127.0.0.1',
'port' => 6379,
'database' => 0,
],
],
];
I am also attaching my .env files
APP_ENV=local
APP_DEBUG=true
APP_KEY=SomeRandomString
DB_HOST=localhost
DB_DATABASE=horsi
DB_USERNAME=root
DB_PASSWORD=
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
I also tried to configure my database like
'host' => env('DB_HOST', 'localhost'),
'database' => env('DB_DATABASE', 'horsi'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
But it is not working, anyone can help me to get the solution
Error: null in place of username and poassword
enter image description here
Try to add this line
'default' => env('DB_DEFAULT', 'mysql')
instead place of
'default' => 'mysql'
And set DB_DEFAULT=mysql in .env file
You use default DB as 'default' => 'mysql'
But .env configs are going for pgsql in your config file.
So if you're going to use MYSQL, set this
'host' => env('DB_HOST', 'localhost'),
'database' => env('DB_DATABASE', 'horsi'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
for mysql section in your config.php

Can't connect to Mysql server with Laravel 5.2

When i add a MySQL connection to my laravel installation it does not seem to work. I double checked every setting, also on the remote server. The credentials are correct and everything should work. Underneath I'll post my controler, view and the database.config files so you can see what's wrong. I've been trying to fix this for the past 2 hours and I just have no idea what is wrong :( When i test if there's data it doesn't say the table does not exist, it just returns null. (I do have select permissions)
Controller
<?php
namespace App\Http\Controllers;
use DB;
use App\Log;
class DataController extends Controller
{
public function index()
{
$logs = Log::distinct()->select(['device_name','device_id'])->get();
return view('data.index', compact('logs'));
}
public function show($device_id)
{
$logs = DB::table('datalog_net_data')->take(100);
return view('data.show', compact('logs'));
}
public function dashboard()
{
$pageTitle = "Dashboard";
return view('data.dashboard', compact('pageTitle'));
}
}
The database config file
<?php
return [
/*
|--------------------------------------------------------------------------
| PDO Fetch Style
|--------------------------------------------------------------------------
|
| By default, database results will be returned as instances of the PHP
| stdClass object; however, you may desire to retrieve records in an
| array format for simplicity. Here you can tweak the fetch style.
|
*/
'fetch' => PDO::FETCH_CLASS,
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for all database work. Of course
| you may use many connections at once using the Database library.
|
*/
'default' => 'mysql',
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple.
|
|
| All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
*/
'connections' => [
'sqlite' => [
'driver' => 'sqlite',
'database' => database_path('database.sqlite'),
'prefix' => '',
],
'mysql' => [
'driver' => 'mysql',
'host' => '192.168.1.113',
'database' => 'gs_database',
'username' => 'laravel',
'password' => '1234',
'charset' => 'Pneunet44',
'collation' => '',
'prefix' => '%',
'strict' => false,
'engine' => null,
],
'pgsql' => [
'driver' => 'pgsql',
'host' => env('DB_HOST', 'localhost'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
],
'sqlsrv' => [
'driver' => 'sqlsrv',
'host' => env('DB_HOST', 'localhost'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
],
],
/*
|--------------------------------------------------------------------------
| Migration Repository Table
|--------------------------------------------------------------------------
|
| This table keeps track of all the migrations that have already run for
| your application. Using this information, we can determine which of
| the migrations on disk haven't actually been run in the database.
|
*/
'migrations' => 'migrations',
/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer set of commands than a typical key-value systems
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
*/
'redis' => [
'cluster' => false,
'default' => [
'host' => env('REDIS_HOST', 'localhost'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => 0,
],
],
];
The return when i var_dump the first log row
http://puu.sh/nJLtV/028b2b5192.jpg
I hope you guys know, because i have no idea.
Change the DB_HOST in you .env file from:
DB_HOST=localhost
to
DB_HOST=127.0.0.1
You also need to grant rights, so your Laravel app could connect remote MySQL server.
Example:
mysql> CREATE DATABASE foo;
mysql> GRANT ALL ON foo.* TO bar#'202.54.10.20' IDENTIFIED BY 'PASSWORD';

keep getting an error in terminal when doing php artisan october:up

I am trying to install october cms and I am currently on the last step where I need to type php artisan october:up but when I do, I keep getting this error:
[PDOException]
SQLSTATE[HY000] [2002] No such file or directory
I added this: 'default' => 'mysql', // Default database connection to config/database.php file.
here is the file:
<?php
return [
/*
|--------------------------------------------------------------------------
| PDO Fetch Style
|--------------------------------------------------------------------------
|
| By default, database results will be returned as instances of the PHP
| stdClass object; however, you may desire to retrieve records in an
| array format for simplicity. Here you can tweak the fetch style.
|
*/
'fetch' => PDO::FETCH_CLASS,
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for all database work. Of course
| you may use many connections at once using the Database library.
|
*/
'default' => 'mysql',
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple.
|
|
| All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
*/
'connections' => [
'sqlite' => [
'driver' => 'sqlite',
'database' => 'storage/database.sqlite',
'prefix' => '',
],
'mysql' => [
'driver' => 'mysql',
'host' => 'localhost',
'port' => '',
'database' => 'database',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
],
'pgsql' => [
'driver' => 'pgsql',
'host' => 'localhost',
'port' => '',
'database' => 'database',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
],
'sqlsrv' => [
'driver' => 'sqlsrv',
'host' => 'localhost',
'port' => '',
'database' => 'database',
'username' => 'root',
'password' => '',
'prefix' => '',
],
],
/*
|--------------------------------------------------------------------------
| Migration Repository Table
|--------------------------------------------------------------------------
|
| This table keeps track of all the migrations that have already run for
| your application. Using this information, we can determine which of
| the migrations on disk have not actually be run in the databases.
|
*/
'migrations' => 'migrations',
/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer set of commands than a typical key-value systems
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
*/
'redis' => [
'cluster' => false,
'default' => [
'host' => '127.0.0.1',
'port' => 6379,
'database' => 0,
],
],
];
these are all the directions on how to install in the console
Console installation
The command-line interface (CLI) method of installation requires Composer to manage its dependencies.
Download the application source code by using create-project in your terminal. This will install to a directory called /myoctober:
composer create-project october/october myoctober dev-master
Once this task has finished, open the file config/database.php and set your database connection:
'default' => 'mysql', // Default database connection
Configure the connections section below it with the database credentials.
Next, run the CLI migration process, this will build the database tables:
php artisan october:up
You can sign in to the back-end area via the /backend route and using the default username admin and password admin.
You also may wish to inspect config/app.php and config/cms.php to change any optional configuration.
any help would be appreciated!
You haven't set up your mysql configuration.
Currently its value is:
'mysql' => [
'driver' => 'mysql',
'host' => 'localhost',
'port' => '',
'database' => 'database',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
],
As a result PHP is trying to connect to mysql using the default socket (which in this case, does not exist, hence the "file does not exist" error from PDO). If you actually want to connect to localhost with user root and no password, I would suggest setting the port number to 3306.

Categories