Discuss / SQL / 新手请教mysql如何正确操作

新手请教mysql如何正确操作

Topic source

Cynthia6268

#1 Created at ... [Delete] [Delete and Lock User]

在桌面上建了一个init-test-data.sql文件,然后在mysql里运行$ mysql -u root -p < init-test-data.sql

回车后输入SELECT * FROM students;

再回车就报错了,如下:

mysql> $ mysql -u root -p < init-test-data.sql

    -> SELECT * FROM students;

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 '$ mysql -u root -p < init-test-data.sql

SELECT * FROM students' at line 1

请问正确的操作步骤是什么?

albertains

#2 Created at ... [Delete] [Delete and Lock User]

你可以看看 “查询数据” 大标题下面的回复


  • 1

Reply