Connecting to database via Command Line

like this $ sudo mysql -u [username] -p -h host [databasename]
(as per mariadb documentation)

returns and error

ERROR 1045 (28000): Access denied for user ‘mysql’@‘localhost’ (using password: YES).

I am on a clone of the standard VirtualBox VM here

clear that access is denied, so there might be several causes.
password, user, host or databasename being wrong so I am trying to narrow this down

  1. user: frappe, or mysql ?
  2. db-name & password (on the default VM here) should be found in frappe-bench/sites/erpnext.vm/site_config.json, right?
  3. host: localhost?

hi @vrms,

Your Password is wrong so it will gives an error try enter correct password.
otherwise ,try this following steps:
1.go to ~/frappe-bench folder
2.use this command “bench mysql”

Sagar Shiragawakar

I believe the mysql password for the virtual machine is frappe

pw ‘frappe’ does is rejected for user = frappe & user = mysql

also I would expect the oassword of the specific database to be required.

maybe I try this from the wrong angle? How to you access your database in the CLI step-by-step?

so, where would I get the correct passwrod from (as the one from site_config.json seems to be incorrect)? again still on the default database from the latest 7.0 VM

yes, that works thanks. (which also answers the question about the mysql user (which seems to be frappe then).

Still I’d love to know how to connect with standard mysql tools as well

try this
1.go to site_config.json
2.Syntax :mysql -u dbname -ppassword(don’t give space after -p)
3.mysql -u e52c854d56 -p12TUM6gqAkW9NBe3


I’ll try this (eventhough it seems very unusual to not put a space after -p) and report back