_DataBase.Dump (gb.mysql)
Sub Dump ( [ Database As String, Tables As String[], File As String, Options As String[], Replace As Boolean ] )
Dumps the current database into a file. This procedure uses mysqldump.
The file parameter should include the path.
If the file is not given, then the generated file will be:
User.Home &/ "Dump_" & hCon.Name & ".sql"
By default include the following options:
--force
Continue even if an SQL error occurs during a table dump.
--no-autocommit
Enclose the INSERT statements for each dumped table within SET AUTOCOMMIT = 0 and COMMIT statements.
--routines
Dump stored routines (functions and procedures) from the dumped database.
Examples
Dim hCon As New Connection
With hCon
.Type = "mysql"
.Port = "3306"
.Host = "localhost"
.User = "root"
.Password = "mypass"
.Name = "Gambas"
.Open()
End With
hCon.MySQL.DataBase.Dump("/tmp/Gambas3.sql")
MySQL statement: mysqldump --force --no-autocommit --routines -u root -h localhost -P 3306 --password='mypass' -B mysql
> /tmp/Gambas3.sql