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

Allow defining database server hostname and port #77

Closed
ToeiRei opened this issue Nov 10, 2016 · 4 comments
Closed

Allow defining database server hostname and port #77

ToeiRei opened this issue Nov 10, 2016 · 4 comments
Assignees
Labels
Milestone

Comments

@ToeiRei
Copy link

ToeiRei commented Nov 10, 2016

bin/install never asks about the MySQL host to use. Assume it assumes localhost.

@acelaya
Copy link
Member

acelaya commented Nov 10, 2016

That's a good point.
I'll fix it

@acelaya acelaya added the bug label Nov 10, 2016
@ToeiRei
Copy link
Author

ToeiRei commented Nov 10, 2016

Anything to hack around that in the meanwhile? (SQlite isn't an alternative.)

@acelaya
Copy link
Member

acelaya commented Nov 10, 2016

Sure.
If I remember correctly, you should be able to set both host and/or port in the config/autoload/entity_manager.global.php file

<?php
return [

    'entity_manager' => [
        'orm' => [
            'proxies_dir' => 'data/proxies',
        ],
        'connection' => [
            'driver' => 'pdo_mysql',
            'user' => env('DB_USER'),
            'password' => env('DB_PASSWORD'),
            'dbname' => env('DB_NAME', 'shlink'),
            'charset' => 'utf8',
            'host' => '1.2.3.4', // <- Add this if you need to change the host
            'port' => 33306, // <- Add this if you need to change the port
            'driverOptions' => [
                PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8',
            ],
        ],
    ],

];

Just remember to delete the data/cache/app_config.php file so that it gets regenerated, otherwise your changes won't take effect.

@acelaya acelaya modified the milestone: 1.3.1 Jan 19, 2017
@acelaya acelaya self-assigned this Jan 19, 2017
@acelaya acelaya changed the title Allow using an external SQL server Allow defining database server hostname and port Jan 21, 2017
@acelaya
Copy link
Member

acelaya commented Jan 21, 2017

Already implemented https://github.com/acelaya/shlink/tree/feature/1.3.1
Will be available in shlink 1.3.1

@acelaya acelaya closed this as completed Jan 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants