Whoops! There was an error.
Illuminate \ Database \ QueryException (2002)
SQLSTATE[HY000] [2002] Connection refused (SQL: select * from `companysetting` limit 1) Illuminate\Database\QueryException thrown with message "SQLSTATE[HY000] [2002] Connection refused (SQL: select * from `companysetting` limit 1)" Stacktrace: #56 Illuminate\Database\QueryException in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664 #55 App\Http\Controllers\web\AboutController:__construct in [internal]:0 #54 PDOException in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:68 #53 PDO:__construct in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:68 #52 Illuminate\Database\Connectors\Connector:createPdoConnection in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:44 #51 Illuminate\Database\Connectors\Connector:createConnection in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Database/Connectors/MySqlConnector.php:24 #50 Illuminate\Database\Connectors\MySqlConnector:connect in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php:183 #49 Illuminate\Database\Connectors\ConnectionFactory:Illuminate\Database\Connectors\{closure} in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Database/Connection.php:915 #48 call_user_func in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Database/Connection.php:915 #47 Illuminate\Database\Connection:getPdo in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Database/Connection.php:940 #46 Illuminate\Database\Connection:getReadPdo in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Database/Connection.php:399 #45 Illuminate\Database\Connection:getPdoForSelect in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Database/Connection.php:325 #44 Illuminate\Database\Connection:Illuminate\Database\{closure} in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Database/Connection.php:657 #43 Illuminate\Database\Connection:runQueryCallback in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Database/Connection.php:624 #42 Illuminate\Database\Connection:run in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Database/Connection.php:333 #41 Illuminate\Database\Connection:select in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:1963 #40 Illuminate\Database\Query\Builder:runSelect in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:1951 #39 Illuminate\Database\Query\Builder:Illuminate\Database\Query\{closure} in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2435 #38 Illuminate\Database\Query\Builder:onceWithColumns in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:1952 #37 Illuminate\Database\Query\Builder:get in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Database/Concerns/BuildsQueries.php:77 #36 Illuminate\Database\Query\Builder:first in /var/www/website/nuode/app/Http/Controllers/web/BaseController.php:83 #35 App\Http\Controllers\web\BaseController:getCompany in /var/www/website/nuode/app/Http/Controllers/web/BaseController.php:27 #34 App\Http\Controllers\web\BaseController:__construct in /var/www/website/nuode/app/Http/Controllers/web/AboutController.php:13 #33 App\Http\Controllers\web\AboutController:__construct in [internal]:0 #32 ReflectionClass:newInstanceArgs in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Container/Container.php:800 #31 Illuminate\Container\Container:build in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Container/Container.php:646 #30 Illuminate\Container\Container:resolve in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Container/Container.php:601 #29 Illuminate\Container\Container:make in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:734 #28 Illuminate\Foundation\Application:make in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Routing/Route.php:226 #27 Illuminate\Routing\Route:getController in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Routing/Route.php:796 #26 Illuminate\Routing\Route:controllerMiddleware in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Routing/Route.php:757 #25 Illuminate\Routing\Route:gatherMiddleware in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Routing/Router.php:678 #24 Illuminate\Routing\Router:gatherRouteMiddleware in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Routing/Router.php:658 #23 Illuminate\Routing\Router:runRouteWithinStack in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Routing/Router.php:642 #22 Illuminate\Routing\Router:runRoute in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Routing/Router.php:608 #21 Illuminate\Routing\Router:dispatchToRoute in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Routing/Router.php:597 #20 Illuminate\Routing\Router:dispatch in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:176 #19 Illuminate\Foundation\Http\Kernel:Illuminate\Foundation\Http\{closure} in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:30 #18 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /var/www/website/nuode/vendor/fideloper/proxy/src/TrustProxies.php:57 #17 Fideloper\Proxy\TrustProxies:handle in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151 #16 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53 #15 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:31 #14 Illuminate\Foundation\Http\Middleware\TransformsRequest:handle in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151 #13 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53 #12 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:31 #11 Illuminate\Foundation\Http\Middleware\TransformsRequest:handle in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151 #10 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53 #9 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php:27 #8 Illuminate\Foundation\Http\Middleware\ValidatePostSize:handle in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151 #7 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53 #6 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php:51 #5 Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode:handle in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151 #4 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53 #3 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:104 #2 Illuminate\Pipeline\Pipeline:then in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:151 #1 Illuminate\Foundation\Http\Kernel:sendRequestThroughRouter in /var/www/website/nuode/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:116 #0 Illuminate\Foundation\Http\Kernel:handle in /var/www/website/nuode/public/index.php:56
56
Illuminate
\
Database
\
QueryException
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Database
/
Connection.php
664
55
App
\
Http
\
Controllers
\
web
\
AboutController
__construct
[internal]
0
54
PDOException
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Database
/
Connectors
/
Connector.php
68
53
PDO
__construct
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Database
/
Connectors
/
Connector.php
68
52
Illuminate
\
Database
\
Connectors
\
Connector
createPdoConnection
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Database
/
Connectors
/
Connector.php
44
51
Illuminate
\
Database
\
Connectors
\
Connector
createConnection
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Database
/
Connectors
/
MySqlConnector.php
24
50
Illuminate
\
Database
\
Connectors
\
MySqlConnector
connect
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Database
/
Connectors
/
ConnectionFactory.php
183
49
Illuminate
\
Database
\
Connectors
\
ConnectionFactory
Illuminate
\
Database
\
Connectors
\
{closure}
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Database
/
Connection.php
915
48
call_user_func
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Database
/
Connection.php
915
47
Illuminate
\
Database
\
Connection
getPdo
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Database
/
Connection.php
940
46
Illuminate
\
Database
\
Connection
getReadPdo
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Database
/
Connection.php
399
45
Illuminate
\
Database
\
Connection
getPdoForSelect
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Database
/
Connection.php
325
44
Illuminate
\
Database
\
Connection
Illuminate
\
Database
\
{closure}
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Database
/
Connection.php
657
43
Illuminate
\
Database
\
Connection
runQueryCallback
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Database
/
Connection.php
624
42
Illuminate
\
Database
\
Connection
run
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Database
/
Connection.php
333
41
Illuminate
\
Database
\
Connection
select
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Database
/
Query
/
Builder.php
1963
40
Illuminate
\
Database
\
Query
\
Builder
runSelect
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Database
/
Query
/
Builder.php
1951
39
Illuminate
\
Database
\
Query
\
Builder
Illuminate
\
Database
\
Query
\
{closure}
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Database
/
Query
/
Builder.php
2435
38
Illuminate
\
Database
\
Query
\
Builder
onceWithColumns
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Database
/
Query
/
Builder.php
1952
37
Illuminate
\
Database
\
Query
\
Builder
get
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Database
/
Concerns
/
BuildsQueries.php
77
36
Illuminate
\
Database
\
Query
\
Builder
first
/
app
/
Http
/
Controllers
/
web
/
BaseController.php
83
35
App
\
Http
\
Controllers
\
web
\
BaseController
getCompany
/
app
/
Http
/
Controllers
/
web
/
BaseController.php
27
34
App
\
Http
\
Controllers
\
web
\
BaseController
__construct
/
app
/
Http
/
Controllers
/
web
/
AboutController.php
13
33
App
\
Http
\
Controllers
\
web
\
AboutController
__construct
[internal]
0
32
ReflectionClass
newInstanceArgs
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Container
/
Container.php
800
31
Illuminate
\
Container
\
Container
build
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Container
/
Container.php
646
30
Illuminate
\
Container
\
Container
resolve
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Container
/
Container.php
601
29
Illuminate
\
Container
\
Container
make
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Foundation
/
Application.php
734
28
Illuminate
\
Foundation
\
Application
make
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Routing
/
Route.php
226
27
Illuminate
\
Routing
\
Route
getController
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Routing
/
Route.php
796
26
Illuminate
\
Routing
\
Route
controllerMiddleware
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Routing
/
Route.php
757
25
Illuminate
\
Routing
\
Route
gatherMiddleware
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Routing
/
Router.php
678
24
Illuminate
\
Routing
\
Router
gatherRouteMiddleware
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Routing
/
Router.php
658
23
Illuminate
\
Routing
\
Router
runRouteWithinStack
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Routing
/
Router.php
642
22
Illuminate
\
Routing
\
Router
runRoute
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Routing
/
Router.php
608
21
Illuminate
\
Routing
\
Router
dispatchToRoute
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Routing
/
Router.php
597
20
Illuminate
\
Routing
\
Router
dispatch
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Foundation
/
Http
/
Kernel.php
176
19
Illuminate
\
Foundation
\
Http
\
Kernel
Illuminate
\
Foundation
\
Http
\
{closure}
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Routing
/
Pipeline.php
30
18
Illuminate
\
Routing
\
Pipeline
Illuminate
\
Routing
\
{closure}
/
vendor
/
fideloper
/
proxy
/
src
/
TrustProxies.php
57
17
Fideloper
\
Proxy
\
TrustProxies
handle
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Pipeline
/
Pipeline.php
151
16
Illuminate
\
Pipeline
\
Pipeline
Illuminate
\
Pipeline
\
{closure}
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Routing
/
Pipeline.php
53
15
Illuminate
\
Routing
\
Pipeline
Illuminate
\
Routing
\
{closure}
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Foundation
/
Http
/
Middleware
/
TransformsRequest.php
31
14
Illuminate
\
Foundation
\
Http
\
Middleware
\
TransformsRequest
handle
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Pipeline
/
Pipeline.php
151
13
Illuminate
\
Pipeline
\
Pipeline
Illuminate
\
Pipeline
\
{closure}
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Routing
/
Pipeline.php
53
12
Illuminate
\
Routing
\
Pipeline
Illuminate
\
Routing
\
{closure}
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Foundation
/
Http
/
Middleware
/
TransformsRequest.php
31
11
Illuminate
\
Foundation
\
Http
\
Middleware
\
TransformsRequest
handle
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Pipeline
/
Pipeline.php
151
10
Illuminate
\
Pipeline
\
Pipeline
Illuminate
\
Pipeline
\
{closure}
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Routing
/
Pipeline.php
53
9
Illuminate
\
Routing
\
Pipeline
Illuminate
\
Routing
\
{closure}
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Foundation
/
Http
/
Middleware
/
ValidatePostSize.php
27
8
Illuminate
\
Foundation
\
Http
\
Middleware
\
ValidatePostSize
handle
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Pipeline
/
Pipeline.php
151
7
Illuminate
\
Pipeline
\
Pipeline
Illuminate
\
Pipeline
\
{closure}
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Routing
/
Pipeline.php
53
6
Illuminate
\
Routing
\
Pipeline
Illuminate
\
Routing
\
{closure}
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Foundation
/
Http
/
Middleware
/
CheckForMaintenanceMode.php
51
5
Illuminate
\
Foundation
\
Http
\
Middleware
\
CheckForMaintenanceMode
handle
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Pipeline
/
Pipeline.php
151
4
Illuminate
\
Pipeline
\
Pipeline
Illuminate
\
Pipeline
\
{closure}
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Routing
/
Pipeline.php
53
3
Illuminate
\
Routing
\
Pipeline
Illuminate
\
Routing
\
{closure}
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Pipeline
/
Pipeline.php
104
2
Illuminate
\
Pipeline
\
Pipeline
then
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Foundation
/
Http
/
Kernel.php
151
1
Illuminate
\
Foundation
\
Http
\
Kernel
sendRequestThroughRouter
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Foundation
/
Http
/
Kernel.php
116
0
Illuminate
\
Foundation
\
Http
\
Kernel
handle
/
public
/
index.php
56
/
var
/
www
/
website
/
nuode
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Database
/
Connection.php
     * @param  array     $bindings
     * @param  \Closure  $callback
     * @return mixed
     *
     * @throws \Illuminate\Database\QueryException
     */
    protected function runQueryCallback($query, $bindings, Closure $callback)
    {
        // To execute the statement, we'll simply call the callback, which will actually
        // run the SQL against the PDO connection. Then we can calculate the time it
        // took to execute and log the query SQL, bindings and time in our memory.
        try {
            $result = $callback($query, $bindings);
        }
 
        // If an exception occurs when attempting to run a query, we'll format the error
        // message to include the bindings with SQL, which will make this exception a
        // lot more helpful to the developer instead of just the database's errors.
        catch (Exception $e) {
            throw new QueryException(
                $query, $this->prepareBindings($bindings), $e
            );
        }
 
        return $result;
    }
 
    /**
     * Log a query in the connection's query log.
     *
     * @param  string  $query
     * @param  array   $bindings
     * @param  float|null  $time
     * @return void
     */
    public function logQuery($query, $bindings, $time = null)
    {
        $this->event(new QueryExecuted($query, $bindings, $time, $this));
 
        if ($this->loggingQueries) {
Arguments
  1. "SQLSTATE[HY000] [2002] Connection refused (SQL: select * from `companysetting` limit 1)"
    
[internal]
/
var
/
www
/
website
/
nuode
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Database
/
Connectors
/
Connector.php
            );
        }
    }
 
    /**
     * Create a new PDO connection instance.
     *
     * @param  string  $dsn
     * @param  string  $username
     * @param  string  $password
     * @param  array  $options
     * @return \PDO
     */
    protected function createPdoConnection($dsn, $username, $password, $options)
    {
        if (class_exists(PDOConnection::class) && ! $this->isPersistentConnection($options)) {
            return new PDOConnection($dsn, $username, $password, $options);
        }
 
        return new PDO($dsn, $username, $password, $options);
    }
 
    /**
     * Determine if the connection is persistent.
     *
     * @param  array  $options
     * @return bool
     */
    protected function isPersistentConnection($options)
    {
        return isset($options[PDO::ATTR_PERSISTENT]) &&
               $options[PDO::ATTR_PERSISTENT];
    }
 
    /**
     * Handle an exception that occurred during connect execution.
     *
     * @param  \Throwable  $e
     * @param  string  $dsn
     * @param  string  $username
Arguments
  1. "SQLSTATE[HY000] [2002] Connection refused"
    
Exception message: SQLSTATE[HY000] [2002] Connection refused
/
var
/
www
/
website
/
nuode
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Database
/
Connectors
/
Connector.php
            );
        }
    }
 
    /**
     * Create a new PDO connection instance.
     *
     * @param  string  $dsn
     * @param  string  $username
     * @param  string  $password
     * @param  array  $options
     * @return \PDO
     */
    protected function createPdoConnection($dsn, $username, $password, $options)
    {
        if (class_exists(PDOConnection::class) && ! $this->isPersistentConnection($options)) {
            return new PDOConnection($dsn, $username, $password, $options);
        }
 
        return new PDO($dsn, $username, $password, $options);
    }
 
    /**
     * Determine if the connection is persistent.
     *
     * @param  array  $options
     * @return bool
     */
    protected function isPersistentConnection($options)
    {
        return isset($options[PDO::ATTR_PERSISTENT]) &&
               $options[PDO::ATTR_PERSISTENT];
    }
 
    /**
     * Handle an exception that occurred during connect execution.
     *
     * @param  \Throwable  $e
     * @param  string  $dsn
     * @param  string  $username
Arguments
  1. "mysql:host=127.0.0.1;port=3306;dbname=nuode"
    
  2. "root"
    
  3. "123456"
    
  4. array:5 [
      8 => 0
      3 => 2
      11 => 0
      17 => false
      20 => false
    ]
    
/
var
/
www
/
website
/
nuode
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Database
/
Connectors
/
Connector.php
        PDO::ATTR_EMULATE_PREPARES => false,
    ];
 
    /**
     * Create a new PDO connection.
     *
     * @param  string  $dsn
     * @param  array   $config
     * @param  array   $options
     * @return \PDO
     */
    public function createConnection($dsn, array $config, array $options)
    {
        list($username, $password) = [
            $config['username'] ?? null, $config['password'] ?? null,
        ];
 
        try {
            return $this->createPdoConnection(
                $dsn, $username, $password, $options
            );
        } catch (Exception $e) {
            return $this->tryAgainIfCausedByLostConnection(
                $e, $dsn, $username, $password, $options
            );
        }
    }
 
    /**
     * Create a new PDO connection instance.
     *
     * @param  string  $dsn
     * @param  string  $username
     * @param  string  $password
     * @param  array  $options
     * @return \PDO
     */
    protected function createPdoConnection($dsn, $username, $password, $options)
    {
        if (class_exists(PDOConnection::class) && ! $this->isPersistentConnection($options)) {
Arguments
  1. "mysql:host=127.0.0.1;port=3306;dbname=nuode"
    
  2. "root"
    
  3. "123456"
    
  4. array:5 [
      8 => 0
      3 => 2
      11 => 0
      17 => false
      20 => false
    ]
    
/
var
/
www
/
website
/
nuode
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Database
/
Connectors
/
MySqlConnector.php
use PDO;
 
class MySqlConnector extends Connector implements ConnectorInterface
{
    /**
     * Establish a database connection.
     *
     * @param  array  $config
     * @return \PDO
     */
    public function connect(array $config)
    {
        $dsn = $this->getDsn($config);
 
        $options = $this->getOptions($config);
 
        // We need to grab the PDO options that should be used while making the brand
        // new connection instance. The PDO options control various aspects of the
        // connection's behavior, and some might be specified by the developers.
        $connection = $this->createConnection($dsn, $config, $options);
 
        if (! empty($config['database'])) {
            $connection->exec("use `{$config['database']}`;");
        }
 
        $this->configureEncoding($connection, $config);
 
        // Next, we will check to see if a timezone has been specified in this config
        // and if it has we will issue a statement to modify the timezone with the
        // database. Setting this DB timezone is an optional configuration item.
        $this->configureTimezone($connection, $config);
 
        $this->setModes($connection, $config);
 
        return $connection;
    }
 
    /**
     * Set the connection character set and collation.
     *
Arguments
  1. "mysql:host=127.0.0.1;port=3306;dbname=nuode"
    
  2. array:13 [
      "driver" => "mysql"
      "host" => "127.0.0.1"
      "port" => "3306"
      "database" => "nuode"
      "username" => "root"
      "password" => "123456"
      "unix_socket" => ""
      "charset" => "utf8mb4"
      "collation" => "utf8mb4_unicode_ci"
      "prefix" => ""
      "strict" => false
      "engine" => null
      "name" => "mysql"
    ]
    
  3. array:5 [
      8 => 0
      3 => 2
      11 => 0
      17 => false
      20 => false
    ]
    
/
var
/
www
/
website
/
nuode
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Database
/
Connectors
/
ConnectionFactory.php
    {
        return array_key_exists('host', $config)
                            ? $this->createPdoResolverWithHosts($config)
                            : $this->createPdoResolverWithoutHosts($config);
    }
 
    /**
     * Create a new Closure that resolves to a PDO instance with a specific host or an array of hosts.
     *
     * @param  array  $config
     * @return \Closure
     */
    protected function createPdoResolverWithHosts(array $config)
    {
        return function () use ($config) {
            foreach (Arr::shuffle($hosts = $this->parseHosts($config)) as $key => $host) {
                $config['host'] = $host;
 
                try {
                    return $this->createConnector($config)->connect($config);
                } catch (PDOException $e) {
                    if (count($hosts) - 1 === $key && $this->container->bound(ExceptionHandler::class)) {
                        $this->container->make(ExceptionHandler::class)->report($e);
                    }
                }
            }
 
            throw $e;
        };
    }
 
    /**
     * Parse the hosts configuration item into an array.
     *
     * @param  array  $config
     * @return array
     */
    protected function parseHosts(array $config)
    {
        $hosts = Arr::wrap($config['host']);
Arguments
  1. array:13 [
      "driver" => "mysql"
      "host" => "127.0.0.1"
      "port" => "3306"
      "database" => "nuode"
      "username" => "root"
      "password" => "123456"
      "unix_socket" => ""
      "charset" => "utf8mb4"
      "collation" => "utf8mb4_unicode_ci"
      "prefix" => ""
      "strict" => false
      "engine" => null
      "name" => "mysql"
    ]
    
/
var
/
www
/
website
/
nuode
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Database
/
Connection.php
 
            $this->doctrineConnection = new DoctrineConnection([
                'pdo' => $this->getPdo(),
                'dbname' => $this->getConfig('database'),
                'driver' => $driver->getName(),
            ], $driver);
        }
 
        return $this->doctrineConnection;
    }
 
    /**
     * Get the current PDO connection.
     *
     * @return \PDO
     */
    public function getPdo()
    {
        if ($this->pdo instanceof Closure) {
            return $this->pdo = call_user_func($this->pdo);
        }
 
        return $this->pdo;
    }
 
    /**
     * Get the current PDO connection used for reading.
     *
     * @return \PDO
     */
    public function getReadPdo()
    {
        if ($this->transactions > 0) {
            return $this->getPdo();
        }
 
        if ($this->recordsModified && $this->getConfig('sticky')) {
            return $this->getPdo();
        }
 
/
var
/
www
/
website
/
nuode
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Database
/
Connection.php
 
            $this->doctrineConnection = new DoctrineConnection([
                'pdo' => $this->getPdo(),
                'dbname' => $this->getConfig('database'),
                'driver' => $driver->getName(),
            ], $driver);
        }
 
        return $this->doctrineConnection;
    }
 
    /**
     * Get the current PDO connection.
     *
     * @return \PDO
     */
    public function getPdo()
    {
        if ($this->pdo instanceof Closure) {
            return $this->pdo = call_user_func($this->pdo);
        }
 
        return $this->pdo;
    }
 
    /**
     * Get the current PDO connection used for reading.
     *
     * @return \PDO
     */
    public function getReadPdo()
    {
        if ($this->transactions > 0) {
            return $this->getPdo();
        }
 
        if ($this->recordsModified && $this->getConfig('sticky')) {
            return $this->getPdo();
        }
 
Arguments
  1. Closure {#502
      class: "Illuminate\Database\Connectors\ConnectionFactory"
      this: ConnectionFactory {#39 …}
      use: {
        $config: array:13 [
          "driver" => "mysql"
          "host" => "127.0.0.1"
          "port" => "3306"
          "database" => "nuode"
          "username" => "root"
          "password" => "123456"
          "unix_socket" => ""
          "charset" => "utf8mb4"
          "collation" => "utf8mb4_unicode_ci"
          "prefix" => ""
          "strict" => false
          "engine" => null
          "name" => "mysql"
        ]
      }
    }
    
/
var
/
www
/
website
/
nuode
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Database
/
Connection.php
    /**
     * Get the current PDO connection used for reading.
     *
     * @return \PDO
     */
    public function getReadPdo()
    {
        if ($this->transactions > 0) {
            return $this->getPdo();
        }
 
        if ($this->recordsModified && $this->getConfig('sticky')) {
            return $this->getPdo();
        }
 
        if ($this->readPdo instanceof Closure) {
            return $this->readPdo = call_user_func($this->readPdo);
        }
 
        return $this->readPdo ?: $this->getPdo();
    }
 
    /**
     * Set the PDO connection.
     *
     * @param  \PDO|\Closure|null  $pdo
     * @return $this
     */
    public function setPdo($pdo)
    {
        $this->transactions = 0;
 
        $this->pdo = $pdo;
 
        return $this;
    }
 
    /**
     * Set the PDO connection used for reading.
     *
/
var
/
www
/
website
/
nuode
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Database
/
Connection.php
    protected function prepared(PDOStatement $statement)
    {
        $statement->setFetchMode($this->fetchMode);
 
        $this->event(new Events\StatementPrepared(
            $this, $statement
        ));
 
        return $statement;
    }
 
    /**
     * Get the PDO connection to use for a select query.
     *
     * @param  bool  $useReadPdo
     * @return \PDO
     */
    protected function getPdoForSelect($useReadPdo = true)
    {
        return $useReadPdo ? $this->getReadPdo() : $this->getPdo();
    }
 
    /**
     * Run an insert statement against the database.
     *
     * @param  string  $query
     * @param  array   $bindings
     * @return bool
     */
    public function insert($query, $bindings = [])
    {
        return $this->statement($query, $bindings);
    }
 
    /**
     * Run an update statement against the database.
     *
     * @param  string  $query
     * @param  array   $bindings
     * @return int
/
var
/
www
/
website
/
nuode
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Database
/
Connection.php
 
    /**
     * Run a select statement against the database.
     *
     * @param  string  $query
     * @param  array  $bindings
     * @param  bool  $useReadPdo
     * @return array
     */
    public function select($query, $bindings = [], $useReadPdo = true)
    {
        return $this->run($query, $bindings, function ($query, $bindings) use ($useReadPdo) {
            if ($this->pretending()) {
                return [];
            }
 
            // For select statements, we'll simply execute the query and return an array
            // of the database result set. Each element in the array will be a single
            // row from the database table, and will either be an array or objects.
            $statement = $this->prepared($this->getPdoForSelect($useReadPdo)
                              ->prepare($query));
 
            $this->bindValues($statement, $this->prepareBindings($bindings));
 
            $statement->execute();
 
            return $statement->fetchAll();
        });
    }
 
    /**
     * Run a select statement against the database and returns a generator.
     *
     * @param  string  $query
     * @param  array  $bindings
     * @param  bool  $useReadPdo
     * @return \Generator
     */
    public function cursor($query, $bindings = [], $useReadPdo = true)
    {
Arguments
  1. true
    
/
var
/
www
/
website
/
nuode
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Database
/
Connection.php
        return $result;
    }
 
    /**
     * Run a SQL statement.
     *
     * @param  string    $query
     * @param  array     $bindings
     * @param  \Closure  $callback
     * @return mixed
     *
     * @throws \Illuminate\Database\QueryException
     */
    protected function runQueryCallback($query, $bindings, Closure $callback)
    {
        // To execute the statement, we'll simply call the callback, which will actually
        // run the SQL against the PDO connection. Then we can calculate the time it
        // took to execute and log the query SQL, bindings and time in our memory.
        try {
            $result = $callback($query, $bindings);
        }
 
        // If an exception occurs when attempting to run a query, we'll format the error
        // message to include the bindings with SQL, which will make this exception a
        // lot more helpful to the developer instead of just the database's errors.
        catch (Exception $e) {
            throw new QueryException(
                $query, $this->prepareBindings($bindings), $e
            );
        }
 
        return $result;
    }
 
    /**
     * Log a query in the connection's query log.
     *
     * @param  string  $query
     * @param  array   $bindings
     * @param  float|null  $time
Arguments
  1. "select * from `companysetting` limit 1"
    
  2. []