1

What I want to know is how to run code which I have put in a text file, in the MySQL command line client, using the SOURCE command. (The text file I put the code in is called 'Testrun').

I know it starts by:

SOURCE C:\Users\Emily\Documents\MySQLpractice

but I don't know how to finish the command. I understand you have to put the file name afterwards, but is there a backslash, a forward slash or something else in-between that and the file path?

What's in the text file:

USE exams;
SELECT * FROM students;

I have tried to look up the answer before but people said different things each time, and I couldn't get anything to work. Help is hugely appreciated.

0

1 Answer 1

1

The proper syntax on windows is:

SOURCE C:/Users/Emily/Documents/MySQLpractice/File.sql;
Sign up to request clarification or add additional context in comments.

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.