0

I am logging in to an sql server using the following command:

mysql -u root 

Then I selected the sql database:

use mysql

After this I wanted to see everything in the users table using the following command:

select * FROM user;

But how do I combine all of these three single commands into one?

I tried:

mysql -u root; use mysql; select * FROM user;

But this did not work, it just logged me into the sql server.

0

2 Answers 2

1

try this:

mysql -u root -e"use mysql; select * FROM user;"
Sign up to request clarification or add additional context in comments.

Comments

0

Please Try This:

$ mysql -u root -p -e 'SELECT * FROM quotes' cbzquotes

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.