How can I create a SQL Script using MySql?

I already created a database and tables. I populated the tables and wrote queries to solve the questions in my homework. But the professor want me to submit the SQL script.

Can anyone help me?

Recommended Answers

All 7 Replies

I tried but it gave me the error:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ...

I tried but it gave me the error:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ...

Can you post what you did ?

mysqldump -u root -p mypassword assignment2 > /C:/Users/Samara/Desktop/HW1.sql

If you let MySQL register its PATH on install you can run dump from any location in your pc, if you did not do so you need to run dump from MySQL installation folder. Point of this is that you do not need to give absolute path to save the SQL file. Your dump command is almost correct beside that slash in front of of C hard drive

mysqldump -u root -p mypassword assignment2 > C:/Users/Samara/Desktop/HW1.sql

but I would prefer it as

mysqldump -u root -p mypassword assignment2 > HW1.sql

this will create HW1.sql in directory from which at that point you calling dump command

I am still getting the same error msg :/

Strange, try this there is virtually no difference just after executing you need to provide password.

mysqldump -u root assignment2 > HW1.sql -p

If this doesn't work try to install MySQL GUI Tools which unlike phpMyAdmin do not need PHP on your pc. Through Administrator you set up connection and then use Query Browser

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.