Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can we run a mysql query through command prompt in windows?

Can we run MySQL query from windows command prompt? If so, how can we do that and process the query result through command prompt?

like image 919
learner Avatar asked Sep 16 '11 12:09

learner


People also ask

Can we use MySQL in command prompt?

Launch the MySQL Command-Line Client. To launch the client, enter the following command in a Command Prompt window: mysql -u root -p . The -p option is needed only if a root password is defined for MySQL. Enter the password when prompted.

How do I run a MySQL query in Windows 10?

To open the MySQL command line from cmd, you need to use username root with your password. Now write the below command to open MySQL command line. Now press the enter button. After that you need to provide the password.


1 Answers

Try to use mysql — the MySQL command-line tool with '--execute=statement' or '-e statement' option.

like image 54
Devart Avatar answered Oct 06 '22 07:10

Devart