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

db:create with mysql : unknown database #726

Open
fiftoine opened this issue Dec 31, 2017 · 0 comments
Open

db:create with mysql : unknown database #726

fiftoine opened this issue Dec 31, 2017 · 0 comments

Comments

@fiftoine
Copy link

  • Platform: Windows 10 64-bit
  • Database: Mysql
  • Lux Version: 1.2.2
  • Node Version: 8.9.3

Hi,

I created a new app

$ lux new myapp --database mysql
$ cd myapp

When I want to create the database:

$ lux db:create

I got an error :

Error: Unknown database 'myapp_dev'
    at Packet.asError (F:\workspace\lux\testApp6\node_modules\mysql2\lib\packets\packet.js:713:13)
    at ClientHandshake.Command.execute (F:\workspace\lux\testApp6\node_modules\mysql2\lib\commands\command.js:28:22)
    at Connection.handlePacket (F:\workspace\lux\testApp6\node_modules\mysql2\lib\connection.js:515:28)
    at PacketParser.onPacket (F:\workspace\lux\testApp6\node_modules\mysql2\lib\connection.js:94:16)
    at PacketParser.executeStart (F:\workspace\lux\testApp6\node_modules\mysql2\lib\packet_parser.js:77:14)
    at Socket.<anonymous> (F:\workspace\lux\testApp6\node_modules\mysql2\lib\connection.js:102:29)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at Socket.Readable.push (_stream_readable.js:208:10)
    at TCP.onread (net.js:594:20)
From previous event:
    at Client_MySQL2.acquireRawConnection (F:\workspace\lux\testApp6\node_modules\knex\lib\dialects\mysql2\index.js:74:12)
    at Object.create (F:\workspace\lux\testApp6\node_modules\knex\lib\client.js:231:16)
    at Pool._createResource (F:\workspace\lux\testApp6\node_modules\generic-pool\lib\generic-pool.js:354:17)
    at Pool._ensureMinimum (F:\workspace\lux\testApp6\node_modules\generic-pool\lib\generic-pool.js:408:12)
    at new Pool (F:\workspace\lux\testApp6\node_modules\generic-pool\lib\generic-pool.js:157:8)
    at Client_MySQL2.initializePool (F:\workspace\lux\testApp6\node_modules\knex\lib\client.js:261:17)
    at Client_MySQL2.Client (F:\workspace\lux\testApp6\node_modules\knex\lib\client.js:108:12)
    at Client_MySQL2.Client_MySQL (F:\workspace\lux\testApp6\node_modules\knex\lib\dialects\mysql\index.js:62:20)
    at new Client_MySQL2 (F:\workspace\lux\testApp6\node_modules\knex\lib\dialects\mysql2\index.js:50:19)
    at Knex (F:\workspace\lux\testApp6\node_modules\knex\lib\index.js:60:34)
    at connect (E:\Users\Antoine\AppData\Roaming\npm\node_modules\lux-framework\src\packages\database\utils\connect.js:54:3
    at dbcreate (E:\Users\Antoine\AppData\Roaming\npm\node_modules\lux-framework\src\packages\cli\commands\dbcreate.js:32:2
    at exec (E:\Users\Antoine\AppData\Roaming\npm\node_modules\lux-framework\bin\lux:56:10)
    at exec.then (E:\Users\Antoine\AppData\Roaming\npm\node_modules\lux-framework\bin\lux:179:19)
    at <anonymous>

It's like Knex try to connect to the myapp_dev database but as it doesn't exist, there is an error.

Is it a bug or something I do wrong?

If a create manually the database myapp_dev, db:migrate and db:seed wotk well.

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