Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Array offset error occurred when reading username and password #5

Closed
ziwon opened this issue Nov 24, 2015 · 3 comments
Closed

Array offset error occurred when reading username and password #5

ziwon opened this issue Nov 24, 2015 · 3 comments

Comments

@ziwon
Copy link

ziwon commented Nov 24, 2015

What should I do? I just ran like:

db-sync --user $DB_USER --password $DB_PASS $DEV_IP $LIVE_IP $table

But, got an error:

#0 phar:///usr/local/bin/db-sync/src/Command/SyncCommand.php(128): Symfony\Component\Debug\ErrorHandler->handleError(8, 'Undefined offse...', 'phar:///usr/loc...', 128, Array)
#1 phar:///usr/local/bin/db-sync/src/Command/SyncCommand.php(102): DbSync\Command\SyncCommand->fire()
#2 phar:///usr/local/bin/db-sync/vendor/symfony/console/Command/Command.php(259): DbSync\Command\SyncCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 phar:///usr/local/bin/db-sync/bin/sync(67): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 phar:///usr/local/bin/db-sync/bin/sync(82): DbSync\Command\App->run(Object(DbSync\Command\SyncCommand))
#5 /usr/local/bin/db-sync(12): require('phar:///usr/loc...')
#6 {main}
@mrjgreen
Copy link
Owner

Looks like you need to fully qualify your table name: [database].[table]

E.g: webshop.customers or webshop.orders etc...

I'll add in some better docs and error handling for this... Thanks for the feedback! :)

@ziwon
Copy link
Author

ziwon commented Nov 25, 2015

Thanks for the rapid reply.

I think it's going to work out by taking your suggestions.

I'll give it a try! :)

@njovujsh
Copy link

$dbh = new PDO('mysql:host=localhost;dbname=db_timesheet', 'root', '');
$dbhx = new PDO('mysql:host=localhost;dbname=db_spotout', 'root', '');
$conmm = new Database\Connection($dbh);
$conff = new Database\Connection($dbhx);

An uncaught Exception was encountered
Type: RuntimeException

Message: The table db_timesheet.db_timesheet.test_table does not have a primary key

Filename: /opt/lampp/htdocs/timesheet/application/vendor/mrjgreen/db-sync/src/DbSync.php

Line Number: 65

Backtrace:

File: /opt/lampp/htdocs/timesheet/application/controllers/Aot.php
Line: 41
Function: sync

File: /opt/lampp/htdocs/timesheet/index.php
Line: 273
Function: require_once

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants