title: Why my datasource is not chanching from 'memory db' to MySQL in LoopBack 4?
body: <p>I'm trying to learn LoopBack 4, so I make the tutorials examples they give in official docs. I want to change the datasource of the todoList example from 'In-memory db' for 'MySQL', but I have been not success, even if I think this is so trivial.</p>
  
  <p>Here is some of code I have.</p>
  
  <p><em>todo.repository.ts</em></p>
  
  <pre><code>export class TodoRepository extends DefaultCrudRepository&lt;
    Todo,
    typeof Todo.prototype.id
    &gt; {
    constructor(
      @inject('datasources.db') dataSource: MysqldbDataSource,
    ) {
      super(Todo, dataSource);
    }
  }
  </code></pre>
  
  <p><em>todo-list.repository.ts</em></p>
  
  <pre><code>export class TodoListRepository extends DefaultCrudRepository&lt;
    TodoList,
    typeof TodoList.prototype.id
    &gt; {
  
    public readonly todos: HasManyRepositoryFactory&lt;
      Todo,
      typeof TodoList.prototype.id
    &gt;;
    constructor(
      @inject('datasources.db') dataSource: MysqldbDataSource,
      @repository.getter(TodoRepository)
      protected todoRepositoryGetter: Getter&lt;TodoRepository&gt;,
    ) {
      super(TodoList, dataSource);
      this.todos = this.createHasManyRepositoryFactoryFor(
        'todos',
        todoRepositoryGetter,
      );
    }
  }
  </code></pre>
  
  <p>As far as I understand, here the repository code is in charge for connecting the controller with the actual data, then I replace the code and changed where it says <code>DbDataSource</code> to <code>MysqldbDataSource</code> as I show you in the code above.</p>
  
  <p>Anyways, I keep having the data in <em>data/db.json</em> (where 'in-memory db' places the data) instead of retrieving data from the actual MySQL database. Any help ins appreciated.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Here is my config for the connection with the MySQL database</p>
  
  <p><em>todo-list.repository.ts</em></p>
  
  <pre><code>{
    "name": "mysqldb",
    "connector": "mysql",
    "url": "mysql://root:123456@localhost/todo",
    "host": "localhost",
    "port": 3306,
    "user": "root",
    "password": "123456",
    "database": "todo"
  }
  </code></pre>