2

I am trying to figure out what the mysql -u root -p command does.

I have googled the command but I can't find any good results.

Funk Forty Niner
  • 74,372
  • 15
  • 66
  • 132
Yuya Kawahara
  • 97
  • 1
  • 1
  • 4

4 Answers4

7

mysql -u root -p means, that you trying to connect to MySQL shell with parameters - -u parameter specified MySQL user name.

-u, --user=name User for login if not current user.

In your case it's root user.

-p, --password[=name] Password to use when connecting to server. If password is not given it's asked from the tty.

You can type mysql --help from the command line for more information about all available parameters.

Good luck.

Viktor
  • 812
  • 1
  • 12
  • 25
3

It logs you into mysql as the root user. After -p (Immediately after it incidentally, no spaces) you would include the password.

mayersdesign
  • 4,657
  • 4
  • 31
  • 46
2
`mysql -u root -p`

Its initiate a connection of MySQL.

-u means that we are going to connect with a username root

-p means that we will enter username's password

Naveed Ramzan
  • 3,509
  • 3
  • 24
  • 28
0

Check man mysql

Your command tries to connect to MySQL on localhost with user "root" and asking for a password

ghostprgmr
  • 468
  • 2
  • 11