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

Instructions for setup with PDO, MySQL ? #377

Closed
jackrabbithanna opened this issue Dec 8, 2020 · 1 comment
Closed

Instructions for setup with PDO, MySQL ? #377

jackrabbithanna opened this issue Dec 8, 2020 · 1 comment

Comments

@jackrabbithanna
Copy link

jackrabbithanna commented Dec 8, 2020

Trying to figure out how to setup this tool with MySQL.

Already have functioning webserver / database, with many Drupal setups.

Would prefer not to have to hassle with MongoDB

Surely I'm missing something easy. Any help appreciated!

Editing config.default.php, updating the 'save.handler' and 'pdo' array values:

'save.handler' => getenv('XHGUI_SAVE_HANDLER') ?: 'pdo',

    'pdo' => [
        'dsn' => 'mysql://root:root@127.0.0.1/xhprof',
        'user' => 'root',
        'pass' => 'root',
        'table' => 'results',
    ],

When I go to the xhgui address in my web browser, I get some error output:

Slim Application Error

The application could not run because of the following error:
Details
Type: PDOException
Code: 3D000
Message: SQLSTATE[3D000]: Invalid catalog name: 1046 No database selected
File: /var/www/html/xhgui/src/Xhgui/Db/PdoRepository.php
Line: 189
Trace

#0 /var/www/html/xhgui/src/Xhgui/Db/PdoRepository.php(189): PDO->exec('\n            CR...')
#1 /var/www/html/xhgui/src/Xhgui/Db/PdoRepository.php(25): XHGui\Db\PdoRepository->initSchema()
#2 /var/www/html/xhgui/src/Xhgui/ServiceContainer.php(142): XHGui\Db\PdoRepository->__construct(Object(PDO), 'results')
#3 /var/www/html/xhgui/vendor/pimple/pimple/src/Pimple/Container.php(118): XHGui\ServiceContainer::XHGui\{closure}(Object(XHGui\ServiceContainer))
#4 /var/www/html/xhgui/src/Xhgui/ServiceContainer.php(150): Pimple\Container->offsetGet('XHGui\\Db\\PdoRep...')
#5 /var/www/html/xhgui/vendor/pimple/pimple/src/Pimple/Container.php(118): XHGui\ServiceContainer::XHGui\{closure}(Object(XHGui\ServiceContainer))
#6 /var/www/html/xhgui/src/Xhgui/ServiceContainer.php(156): Pimple\Container->offsetGet('searcher.pdo')
#7 /var/www/html/xhgui/vendor/pimple/pimple/src/Pimple/Container.php(118): XHGui\ServiceContainer::XHGui\{closure}(Object(XHGui\ServiceContainer))
#8 /var/www/html/xhgui/src/Xhgui/ServiceContainer.php(193): Pimple\Container->offsetGet('searcher')
#9 /var/www/html/xhgui/vendor/pimple/pimple/src/Pimple/Container.php(114): XHGui\ServiceContainer::XHGui\{closure}(Object(XHGui\ServiceContainer))
#10 /var/www/html/xhgui/src/routes.php(41): Pimple\Container->offsetGet('runController')
#11 [internal function]: {closure}()
#12 /var/www/html/xhgui/vendor/slim/slim/Slim/Route.php(468): call_user_func_array(Object(Closure), Array)
#13 /var/www/html/xhgui/vendor/slim/slim/Slim/Slim.php(1355): Slim\Route->dispatch()
#14 /var/www/html/xhgui/vendor/slim/slim/Slim/Middleware/Flash.php(85): Slim\Slim->call()
#15 /var/www/html/xhgui/vendor/slim/slim/Slim/Middleware/MethodOverride.php(92): Slim\Middleware\Flash->call()
#16 /var/www/html/xhgui/vendor/slim/slim/Slim/Middleware/SessionCookie.php(110): Slim\Middleware\MethodOverride->call()
#17 /var/www/html/xhgui/src/Xhgui/Middleware/RenderMiddleware.php(14): Slim\Middleware\SessionCookie->call()
#18 /var/www/html/xhgui/vendor/slim/slim/Slim/Middleware/PrettyExceptions.php(67): XHGui\Middleware\RenderMiddleware->call()
#19 /var/www/html/xhgui/vendor/slim/slim/Slim/Slim.php(1300): Slim\Middleware\PrettyExceptions->call()
#20 /var/www/html/xhgui/webroot/index.php(13): Slim\Slim->run()
#21 {main}
@jackrabbithanna
Copy link
Author

['pdo']['dsn'] should be something like 'mysql:host=localhost;dbname=xhprof'

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

1 participant