Laravel database query BUG

Source: Internet
Author: User
The Basetableorviewnotfound: 1146 Table & #039; homestead. fyl_menu & #039; doesn & #039; texist (SQL: select * fromfyl_menu) error occurs when I install laravel12.2.0 in the morning. My laravel configuration file {code...} Me... I installed laravel 12.2.0 in the morning.
Base table or view not found: 1146 Table 'homestead. fyl_menu 'doesn' t exist (SQL: select * from fyl_menu)
Error.
My laravel configuration file

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

The fyl_menu table exists in the fyl database in my database. Unfortunately, the error message does prompt homestead. fyl_menu. In the laravl framework, the makeConnection method in IlluminateDatabaseDatabaseManager prints the config variable to output homestead data. Modification to other fields in the configuration file is valid.
Hope you will be familiar with lavavel.

Reply content:

In the morning, I installed laravel 12.2.0.
Base table or view not found: 1146 Table 'homestead. fyl_menu 'doesn' t exist (SQL: select * from fyl_menu)
Error.
My laravel configuration file

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

The fyl_menu table exists in the fyl database in my database. Unfortunately, the error message does prompt homestead. fyl_menu. In the laravl framework, the makeConnection method in IlluminateDatabaseDatabaseManager prints the config variable to output homestead data. Modification to other fields in the configuration file is valid.
Hope you will be familiar with lavavel.

The configuration file is in.env

Env ('db _ host', 'localhost') indicates that he will go back to the. env file and find DB_HOST. If the file cannot be found, use the localhost

It is best not to use the config/database. the PHP file is usually used to configure databases. env file configuration, because if you use git ,. the env file is in. the gitignore file is not submitted. If you configure it in the datebase file, you can check the database configuration data, which is not safe.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.