This documentation relates to the latest version of Confluence.
If you are using an earlier version, please go to the documentation home page and select the relevant previous version.

How to run a SQL script on your database

Confluence 2.8 Documentation

Index

This document contains some basic instructions on how to run a SQL script on your database. This document is not intended to be exhaustive of the databases we support. We still recommend that you ask your DBA to perform this task if possible.

The following examples assume a database name of yourdb and a script file called myscript.sql. Of course, the extension of the SQL script file does not have to be .sql. Any file can be used so long as it contains SQL statements.

MySQL

mysql yourdb < myscript.sql

PostgreSQL

psql yourdb < myscrpt.sql

Labels:

Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.
  1. Apr 25

    Preston Tollinger says:

    For mysql I recommend adding the \force option so it doesn't fail if some but no...

    For mysql I recommend adding the --force option so it doesn't fail if some but not all of the indexes exist.

    mysql --force yourdb < myscript.sql
    

Add Comment