Summary of Common Methods for Connecting to Databases in Linux Systems

Summary of Common Methods for Connecting to Databases in Linux Systems

1. MySQL/MariaDB Connection 1. Command Line Connection mysql -u username -p -h host_address -P port Example: mysql -u root -p -h 127.0.0.1 -P 3306 Parameter Description: <span><span>-u</span></span>: Username <span><span>-p</span></span>: Interactive password input (no space after password) <span><span>-h</span></span>: Database server IP (default is localhost) <span><span>-P</span></span>: Port (default is 3306) 2. Operations After Connection SHOW DATABASES; — … Read more