Mysql Command Line Client

From NovaOrdis Knowledge Base
Revision as of 02:07, 30 March 2021 by Ovidiu (talk | contribs) (→‎Connect)
Jump to navigation Jump to search

Internal

Connect

mysql -u root -p
mysql -u root -p<password>

No space after -p.

The username and password can also be stored in ~/.my.cnf:

[client]
user = root
password = XXXXXXXX

Scripting Database Interaction

mysql -u root -p<password> < statements.sql