Home >Database >Mysql Tutorial >How Do I Connect to MySQL from the Mac Command Line?
Connecting to MySQL from the Mac Command Line
When following PHP/SQL tutorials, the assumption is often made that you're already connected to MySQL. Here's how to initiate this connection from the Mac command line:
mysql -u USERNAME -pPASSWORD -h HOSTNAMEORIP DATABASENAME
Option Breakdown:
Additional Tips:
mysql -u USERNAME -h HOSTNAMEORIP DATABASENAME -p
The above is the detailed content of How Do I Connect to MySQL from the Mac Command Line?. For more information, please follow other related articles on the PHP Chinese website!