MySQL: Read a file from a session

This entry is part 7 of 26 in the series Learn MySQL

Alternatively, to read a file of SQL statements from within a mysql session, use a source filename command (or \. filename, which is the same).

mysql> source insert.sql

mysql>\. insert.sql

The 2 mysql statements inside the file insert.sql are:

use allartist
insert into artist (artiste, album, price) values ('Madonna','Immaculate',8.00)


Series Navigation<< MySQL: Reading SQL statements from file
MySQL: Using mysqldump to backup database >>