新手很容易搞错执行source位置,直接在linux系统执行,source是mysql的执行命令,应该登录到mysql取执行。
[root@mv171 tmp]# source /tmp/binlog28.sql
-bash: /*!50530: No such file or directory
-bash: /*!40019: No such file or directory
-bash: /*!50003: No such file or directory
-bash: DELIMITER: command not found
-bash: ROLLBACK/*!*/: No such file or directory
-bash: BINLOG: command not found
-bash: SET: command not found
-bash: SET: command not found
-bash: SET: command not found
-bash: SET: command not found
-bash: SET: command not found
-bash: /*!C: No such file or directory
-bash: SET: command not found
-bash: SET: command not found
-bash: SET: command not found
-bash: create: command not found
-bash: /*!*/: No such file or directory
-bash: delay: command not found
-bash: use: command not found
-bash: SET: command not found
-bash: /tmp/binlog28.sql: line 31: syntax error near unexpected token `('
-bash: /tmp/binlog28.sql: line 31: `create table t1 (id int)'
正确操作:
mysql> source /tmp/binlog28.sql
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected, 1 warning (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)