Comments (5)
hello @hiqsol I know this is not a priority there is some missing configuration, there is a way to solve it I would appreciate your comment,
Greetings.
from db.
We hope that as a Christmas gift we have the connection of the database ready to be able to continue advancing.
from db.
Please give instruction how to reproduce it.
from db.
install yii-base-web if you enable in the view to login in the application, when you click throws this exception.
It seems that there is no connection between db and activerecord,
**Config DB:**
/config/params.php
'db.dsn' => 'mysql:host=127.0.0.1;dbname=app_backup;charset=utf8',
'db.username' => 'app_web',
'db.password' => 'app_password',
PDOException: SQLSTATE[HY000]: General error: 1096 No tables used in /home/app.web/public_html/vendor/yiisoft/db/src/Command.php:1258
Stack trace:
#0 /home/app.web/public_html/vendor/yiisoft/db/src/Command.php(1258): PDOStatement->execute()
#1 /home/app.web/public_html/vendor/yiisoft/db/src/Command.php(1148): yii\db\Command->internalExecute('SELECT *')
#2 /home/app.web/public_html/vendor/yiisoft/db/src/Command.php(413): yii\db\Command->queryInternal('fetch', NULL)
#3 /home/app.web/public_html/vendor/yiisoft/db/src/Query.php(274): yii\db\Command->queryOne()
#4 /home/app.web/public_html/vendor/yiisoft/active-record/src/ActiveQuery.php(294): yii\db\Query->one(NULL)
#5 /home/app.web/public_html/vendor/yiisoft/active-record/src/BaseActiveRecord.php(111): yii\activerecord\ActiveQuery->one()
#6 /home/app.web/public_html/vendor/yiisoft/yii-base-web/src/models/User.php(83): yii\activerecord\BaseActiveRecord::findOne(Array)
#7 /home/app.web/public_html/vendor/yiisoft/yii-base-web/src/forms/LoginForm.php(77): yii\app\models\User::findByUsername('tecnologiaterab...')
#8 /home/app.web/public_html/vendor/yiisoft/yii-base-web/src/forms/LoginForm.php(49): yii\app\forms\LoginForm->getUser()
#9 [internal function]: yii\app\forms\LoginForm->validatePassword('password', NULL, Object(yii\validators\InlineValidator))
#10 /home/app.web/public_html/vendor/yiisoft/yii-core/src/validators/InlineValidator.php(72): call_user_func(Array, 'password', NULL, Object(yii\validators\InlineValidator))
#11 /home/app.web/public_html/vendor/yiisoft/yii-core/src/validators/Validator.php(274): yii\validators\InlineValidator->validateAttribute(Object(yii\app\forms\LoginForm), 'password')
#12 /home/app.web/public_html/vendor/yiisoft/yii-core/src/base/Model.php(364): yii\validators\Validator->validateAttributes(Object(yii\app\forms\LoginForm), Array)
#13 /home/app.web/public_html/vendor/yiisoft/yii-base-web/src/forms/LoginForm.php(63): yii\base\Model->validate()
#14 /home/app.web/public_html/vendor/yiisoft/yii-base-web/src/controllers/SiteController.php(87): yii\app\forms\LoginForm->login()
#15 /home/app.web/public_html/vendor/yiisoft/yii-core/src/base/InlineAction.php(56): yii\app\controllers\SiteController->actionLogin()
#16 /home/app.web/public_html/vendor/yiisoft/yii-core/src/base/Controller.php(160): yii\base\InlineAction->runWithParams(Array)
#17 /home/app.web/public_html/vendor/yiisoft/yii-core/src/base/Module.php(542): yii\base\Controller->runAction('login', Array)
#18 /home/app.web/public_html/vendor/yiisoft/yii-web/src/Application.php(94): yii\base\Module->runAction('site/login', Array)
#19 /home/app.web/public_html/vendor/yiisoft/yii-core/src/base/Application.php(544): yii\web\Application->handleRequest(Object(yii\web\Request))
#20 /home/app.web/public_html/public/index.php(14): yii\base\Application->run()
#21 /home/app.web/public_html/public/index.php(15): {closure}()
#22 {main}
Next yii\db\Exception: SQLSTATE[HY000]: General error: 1096 No tables used
The SQL being executed was: SELECT * in /home/app.web/public_html/vendor/yiisoft/db/src/Schema.php:664
Stack trace:
#0 /home/app.web/public_html/vendor/yiisoft/db/src/Command.php(1263): yii\db\Schema->convertException(Object(PDOException), 'SELECT *')
#1 /home/app.web/public_html/vendor/yiisoft/db/src/Command.php(1148): yii\db\Command->internalExecute('SELECT *')
#2 /home/app.web/public_html/vendor/yiisoft/db/src/Command.php(413): yii\db\Command->queryInternal('fetch', NULL)
#3 /home/app.web/public_html/vendor/yiisoft/db/src/Query.php(274): yii\db\Command->queryOne()
#4 /home/app.web/public_html/vendor/yiisoft/active-record/src/ActiveQuery.php(294): yii\db\Query->one(NULL)
#5 /home/app.web/public_html/vendor/yiisoft/active-record/src/BaseActiveRecord.php(111): yii\activerecord\ActiveQuery->one()
#6 /home/app.web/public_html/vendor/yiisoft/yii-base-web/src/models/User.php(83): yii\activerecord\BaseActiveRecord::findOne(Array)
#7 /home/app.web/public_html/vendor/yiisoft/yii-base-web/src/forms/LoginForm.php(77): yii\app\models\User::findByUsername('tecnologiaterab...')
#8 /home/app.web/public_html/vendor/yiisoft/yii-base-web/src/forms/LoginForm.php(49): yii\app\forms\LoginForm->getUser()
#9 [internal function]: yii\app\forms\LoginForm->validatePassword('password', NULL, Object(yii\validators\InlineValidator))
#10 /home/app.web/public_html/vendor/yiisoft/yii-core/src/validators/InlineValidator.php(72): call_user_func(Array, 'password', NULL, Object(yii\validators\InlineValidator))
#11 /home/app.web/public_html/vendor/yiisoft/yii-core/src/validators/Validator.php(274): yii\validators\InlineValidator->validateAttribute(Object(yii\app\forms\LoginForm), 'password')
#12 /home/app.web/public_html/vendor/yiisoft/yii-core/src/base/Model.php(364): yii\validators\Validator->validateAttributes(Object(yii\app\forms\LoginForm), Array)
#13 /home/app.web/public_html/vendor/yiisoft/yii-base-web/src/forms/LoginForm.php(63): yii\base\Model->validate()
#14 /home/app.web/public_html/vendor/yiisoft/yii-base-web/src/controllers/SiteController.php(87): yii\app\forms\LoginForm->login()
#15 /home/app.web/public_html/vendor/yiisoft/yii-core/src/base/InlineAction.php(56): yii\app\controllers\SiteController->actionLogin()
#16 /home/app.web/public_html/vendor/yiisoft/yii-core/src/base/Controller.php(160): yii\base\InlineAction->runWithParams(Array)
#17 /home/app.web/public_html/vendor/yiisoft/yii-core/src/base/Module.php(542): yii\base\Controller->runAction('login', Array)
#18 /home/app.web/public_html/vendor/yiisoft/yii-web/src/Application.php(94): yii\base\Module->runAction('site/login', Array)
#19 /home/app.web/public_html/vendor/yiisoft/yii-core/src/base/Application.php(544): yii\web\Application->handleRequest(Object(yii\web\Request))
#20 /home/app.web/public_html/public/index.php(14): yii\base\Application->run()
#21 /home/app.web/public_html/public/index.php(15): {closure}()
#22 {main}
Additional Information:
Array
(
[0] => HY000
[1] => 1096
[2] => No tables used
)
$_POST = [
'_csrf' => 'oDuCjUy4CVh-K5ho9FNFrzUSU5agyRSDfzmgn00sIf2RDs7dC_F_NE9Awh6XMjPlfUM7_figeuo-cPrqFWIMiA==',
'LoginForm' => [
'username' => 'user',
'password' => 'password',
'rememberMe' => '1',
],
'login-button' => '',
];
$_COOKIE = [
'locale' => 'es',
'PHPSESSID' => '0373faa6dc35bd838831e48d7e17ab21',
'_csrf' => '15LPGIvl1kZvcavJHQhkXiniAIZuXN-u',
];
from db.
Checking well @hiqsol the problem is in the active-record, ActiveRecord.php loads the schema correctly, but in ActiveQuery.php does not load the connection, so I'll close the problem and open it in active-record.
from db.
Related Issues (20)
- `CommandInterface::getRawSQL()` - using in production / alternative HOT 12
- `Schema::hasTableName()` method is missing HOT 1
- Allow scalars `int|float|bool` in `Query::select()` HOT 1
- Changes before release 2.0.0
- Allow use `DMLQueryBuilderInterface::batchInsert()` without `$columns` HOT 4
- Add posibility to drop table `IF EXISTS` and `CASCADE`
- Allow pass `ExpressionInterface` as alias to `QueryPartsInterface::withQuery()` HOT 1
- No usage of `AbstractCommand::requireTransaction()` HOT 3
- Needs to refactor `getRawSql()`
- Bug in `Command::insertWithReturningPks()` with empty values
- `Command::upsertWithReturningPks()` required for `ActiveRecord::upsert()`
- update irc link
- Bug when try to `Command::update()` using `Expression`s in values or in where condition
- Add ability to create like condition as `%value`, `value%` and `value` without `%`
- Add new method `SchemaInterface::getUserDefinedTypes()`
- Add ability to create `SELECT` with `FOR UPDATE`
- Refactoring of `DbArrayHelper`
- Needs to refactor `Query::each()`
- Changes after release 2.0.0
- Fix `float` type in `AbstractCommand::getRawSql()`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from db.