Languages

Login to MySQL from cmd on Linux

1 points
Asked by:
AnnLen
9090

How can I connect with command line to MySQL on Linux?

1 answer
2 points
Answered by:
AnnLen
9090

Quick solution, just enter: 

mysql -u root -p

It will ask you for password. In case you want to login on any other user, instead of 'root' use other user name.

Example:

If we want to enter password in the same line:

mysql -u root -proot

Parameter -p is connected with our password in this case the password is root.

When we use MySQL or MariaDB for tests on localhost or VM's we use root or admin as a password, for convenience when the security is not so importnat. 

Example:

0 comments Add comment
Native Advertising
50 000 ad impressions - 449$
🚀
Get your tech brand or product in front of software developers.
For more information contact us:
Red dot
Dirask - friendly IT community for everyone.

❤️💻 🙂

Join