-1
Experiencing an error mysql reports when running a migration with Adonis (I’m starting in the nodejs world).
The application runs smoothly on my machine, when passing it to the server that in the future will be the production one, I try to run the migration with Adonis:
adonis migration:run
And get this output:
<code>
# adonis migration:run
{ Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'repair'@'localhost' (using password: YES)
at Handshake.Sequence._packetToError ([...]/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14)
at Handshake.ErrorPacket ([...]/node_modules/mysql/lib/protocol/sequences/Handshake.js:123:18)
</code>
And it ends like this:
<code>
code: 'ER_ACCESS_DENIED_ERROR',
errno: 1045,
sqlMessage:
'Access denied for user \'repair\'@\'localhost\' (using password: YES)',
sqlState: '28000',
fatal: true }
</code>
Only that I can, on this server, enter mysql with the user in question: "Repair". The file ". env", if I change DB_HOST to the server address I get a "Conection Refused" /"ECONNREFUSED". The user password in the file ". env" is correct.
The file . env:
<code>
HOST=[endereço/ip do servidor]
PORT=3333
NODE_ENV=development
APP_NAME=AdonisJs
APP_URL=http://${HOST}:${PORT}
CACHE_VIEWS=false
APP_KEY=[chave]
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_USER=repair
DB_PASSWORD=[senha]
DB_DATABASE=repair
HASH_DRIVER=bcrypt
</code>
The error "1045" I get when DB_HOST=localhost. I’ve already updated the user to @'%'... Getting the same answer.
I can log into the server, access the database with the user, create tables, insert etc... (the server is hosted along with the backend application). Read your post, I made changes to . env and it hasn’t worked yet.
– Raul Castro