Connect to mysql in CLI - distinguish db name and password -



Connect to mysql in CLI - distinguish db name and password -

i trying next mysql command:

zcat ***.sql.gz | mysql -u root -p dbname

maybe question applies as following, simpler command:

mysql -u root -p dbname

you can find kind of snippet on internet, , works. should prompt db user's password (in case, db root pw), , utilize "dbname" database name. today did not inquire me root pw, , instead said

access denied user 'root'@'localhost' (using password: yes)

i assume in case mysql thought "dbname" password. don't understand why in usual case understands "dbname" database name.

i have seen variation:

mysql -u root -pthepassword dbname

here interesting thing -u followed space, -p not.

the question: how mysql distinguish dbname password?

mysql

Comments

Popular posts from this blog

php - How to pass multiple values from url -

database - php search bar when I press submit with nothing in the search bar it shows all the data -

ios - How to load .png images from Documents folder of an app -