久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <legend id='HKchL'><style id='HKchL'><dir id='HKchL'><q id='HKchL'></q></dir></style></legend>
    <i id='HKchL'><tr id='HKchL'><dt id='HKchL'><q id='HKchL'><span id='HKchL'><b id='HKchL'><form id='HKchL'><ins id='HKchL'></ins><ul id='HKchL'></ul><sub id='HKchL'></sub></form><legend id='HKchL'></legend><bdo id='HKchL'><pre id='HKchL'><center id='HKchL'></center></pre></bdo></b><th id='HKchL'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='HKchL'><tfoot id='HKchL'></tfoot><dl id='HKchL'><fieldset id='HKchL'></fieldset></dl></div>
    <tfoot id='HKchL'></tfoot>

        <bdo id='HKchL'></bdo><ul id='HKchL'></ul>

      1. <small id='HKchL'></small><noframes id='HKchL'>

      2. PHP Laravel:無法建立連接,因為目標(biāo)機器主動拒絕

        PHP Laravel: No connection could be made because the target machine actively refused it(PHP Laravel:無法建立連接,因為目標(biāo)機器主動拒絕它)

            <tbody id='GpFcv'></tbody>
            <bdo id='GpFcv'></bdo><ul id='GpFcv'></ul>

            <small id='GpFcv'></small><noframes id='GpFcv'>

            • <i id='GpFcv'><tr id='GpFcv'><dt id='GpFcv'><q id='GpFcv'><span id='GpFcv'><b id='GpFcv'><form id='GpFcv'><ins id='GpFcv'></ins><ul id='GpFcv'></ul><sub id='GpFcv'></sub></form><legend id='GpFcv'></legend><bdo id='GpFcv'><pre id='GpFcv'><center id='GpFcv'></center></pre></bdo></b><th id='GpFcv'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='GpFcv'><tfoot id='GpFcv'></tfoot><dl id='GpFcv'><fieldset id='GpFcv'></fieldset></dl></div>
                  <legend id='GpFcv'><style id='GpFcv'><dir id='GpFcv'><q id='GpFcv'></q></dir></style></legend><tfoot id='GpFcv'></tfoot>

                  本文介紹了PHP Laravel:無法建立連接,因為目標(biāo)機器主動拒絕它的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我正在 Laravel 5 中構(gòu)建一個 Web 應(yīng)用程序.該應(yīng)用程序應(yīng)該將類別名稱"存儲在 MySQL 數(shù)據(jù)庫中,并顯示一個表單以添加新的類別名稱".當(dāng)我執(zhí)行命令 php artisan serve 并導(dǎo)航到 http://localhost:8000/admin/categories/,我收到以下錯誤消息:

                  I am building a web application in Laravel 5. The application is supposed to get "category names" stored on a MySQL database and display a form to add new "category names". When I execute the command php artisan serve and I navigate to http://localhost:8000/admin/categories/, I receive the following error message:

                  PDOException in Connector.php line 50:
                  SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it.
                  

                  根據(jù)我讀到的關(guān)于堆棧溢出的幾篇文章,許多遇到此錯誤的用戶沒有正確配置 .env 文件,該文件覆蓋了在 database.php 文件中指定的 PHP 數(shù)據(jù)對象 (PDO) 的默認(rèn)設(shè)置..env 文件定義如下:

                  According to several posts I read on stack overflow, many users encountering this error did not properly configure the .env file, which overrides the default settings for the PHP Data Object (PDO), as specified in the database.php file. The .env file is defined below:

                  DB_HOST=localhost
                  DB_DATABASE=homestead
                  DB_USERNAME=homestead
                  DB_PASSWORD=secret
                  

                  database.php 文件中的 mysql 鍵為:

                  And the mysql key within the database.php file is given as:

                   'mysql' => [
                              'driver'    => 'mysql',
                              'host'      => env('DB_HOST', 'localhost'),
                              'database'  => env('DB_DATABASE', 'homestead'),
                              'username'  => env('DB_USERNAME', 'homestead'),
                              'password'  => env('DB_PASSWORD', 'secret'),
                              'charset'   => 'utf8',
                              'collation' => 'utf8_unicode_ci',
                              'prefix'    => '',
                              'strict'    => false,
                  

                  奇怪的是,當(dāng)我通過 ssh 進入我的虛擬機并運行 mysql -uhomestead -psecret homestead 時,我能夠連接到數(shù)據(jù)庫.問題是,當(dāng)我可以用相同的參數(shù)直接連接到它時,為什么 Laravel 無法連接到 MySQL?還有什么可以拒絕訪問 Laravel?

                  Oddly, when I ssh into my virtual machine and I run mysql -uhomestead -psecret homestead, I am able to connect to the database. The question is, why is Laravel unable to connect to MySQL when I can connect to it directly with the same parameters? What else could be denying access to Laravel?

                  推薦答案

                  我將 homestead.yaml 中指定的 ip 地址從 localhost 更改為 192.168.10.10.然后我運行了 homestead provision,這似乎解決了問題.主機無法解析 localhost 或 127.0.0.1,因為它們已經(jīng)映射到自身.

                  I changed the ip address specified in the homestead.yaml from localhost to 192.168.10.10. Then I ran homestead provision and that seemed to fix the problem. The host machine cannot resolve localhost or 127.0.0.1 because that is already mapped to itself.

                  這篇關(guān)于PHP Laravel:無法建立連接,因為目標(biāo)機器主動拒絕它的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  MySQLi prepared statement amp; foreach loop(MySQLi準(zhǔn)備好的語句amp;foreach 循環(huán))
                  Is mysqli_insert_id() gets record from whole server or from same user?(mysqli_insert_id() 是從整個服務(wù)器還是從同一用戶獲取記錄?)
                  PHP MySQLi doesn#39;t recognize login info(PHP MySQLi 無法識別登錄信息)
                  mysqli_select_db() expects exactly 2 parameters(mysqli_select_db() 需要 2 個參數(shù))
                  Php mysql pdo query: fill up variable with query result(Php mysql pdo 查詢:用查詢結(jié)果填充變量)
                  MySQLI 28000/1045 Access denied for user #39;root#39;@#39;localhost#39;(MySQLI 28000/1045 用戶“root@“l(fā)ocalhost的訪問被拒絕)

                    <small id='ezDlD'></small><noframes id='ezDlD'>

                    <legend id='ezDlD'><style id='ezDlD'><dir id='ezDlD'><q id='ezDlD'></q></dir></style></legend>
                      1. <tfoot id='ezDlD'></tfoot>

                            <tbody id='ezDlD'></tbody>
                            <bdo id='ezDlD'></bdo><ul id='ezDlD'></ul>
                            <i id='ezDlD'><tr id='ezDlD'><dt id='ezDlD'><q id='ezDlD'><span id='ezDlD'><b id='ezDlD'><form id='ezDlD'><ins id='ezDlD'></ins><ul id='ezDlD'></ul><sub id='ezDlD'></sub></form><legend id='ezDlD'></legend><bdo id='ezDlD'><pre id='ezDlD'><center id='ezDlD'></center></pre></bdo></b><th id='ezDlD'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='ezDlD'><tfoot id='ezDlD'></tfoot><dl id='ezDlD'><fieldset id='ezDlD'></fieldset></dl></div>

                            主站蜘蛛池模板: 蜜桃视频一区二区三区 | 青青草这里只有精品 | 国产第一区二区 | 色资源在线观看 | 天天澡天天狠天天天做 | 欧美日韩中文字幕 | 日韩视频免费看 | 亚洲精品在线免费观看视频 | 久久久久久成人网 | 综合色在线| www国产亚洲精品久久网站 | 精品一区国产 | 亚洲国产成人精 | 奇米在线| 亚洲国产精品99久久久久久久久 | 综合久久99 | 欧美不卡一区二区三区 | 欧美日韩国产一区二区三区 | 成人在线网址 | 91视频大全 | 亚洲天堂999 | 日韩欧美国产一区二区三区 | 久久人 | 伊人久久大香线 | 国产伦精品一区二区三区视频金莲 | 欧美伊人影院 | 亚洲成在线观看 | 欧美久久久久久久 | 9久久婷婷国产综合精品性色 | 国产精品一区二区无线 | 在线观看亚洲专区 | 欧美精品区 | 国产日韩欧美一区 | 亚洲二区在线 | 一区免费 | 中文日韩字幕 | 97视频在线观看免费 | 九九亚洲| 欧美精品一区在线观看 | 一区二区在线免费播放 | 日韩欧美在线观看 |