3

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,450
  • 15
  • 68
  • 141
Yuya Kawahara
  • 107
  • 1
  • 1
  • 4

4 Answers4

8

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
  • 819
  • 1
  • 12
  • 26
3

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

mayersdesign
  • 5,062
  • 4
  • 35
  • 47
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,565
  • 3
  • 25
  • 30
0

Check man mysql

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

ghostprgmr
  • 488
  • 2
  • 11