java -jar liquibase.jar update
在同一个目录下建立,liquibase.properties
内容如下
#liquibase.properties driver: com.mysql.jdbc.Driver classpath: jdbcdriver.jar changeLogFile:changelog.xml url:jdbc:mysql://192.168.0.182:3306/bbscs8?useUnicode=true&characterEncoding=UTF-8 username:root1 password:testroot
jdbcdriver是同一目录下数据库的jar包,changelog.xml为改变数据库的内容,
以下是changelog.xml的内容
<?xml version="1.0" encoding="UTF-8"?> <databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog/1.7" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog/1.7 http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.7.xsd"> </databaseChangeLog>
运行一次,数据库里面生成两张表
databasechangelog
databasechangeloglock两种表
然后将改变数据库的语句加入