How to run a MySQL command from the command line

Summary

Use -e to execute the command. Here is what that will look like:

mysql -u  -p -e "create database database_name"

Reference

Run a single MySQL query from the command line

 

Share this article

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top