安装
groupadd mysql
useradd -g mysql mysql
tar -zxf mysql-VERSION.tar.gz
cd mysql-VERSION
./configure --with-charset=utf8 --prefix=/usr/local/mysql
make
make install
cp support-files/my-medium.cnf /etc/my.cnf
cd /usr/local/mysql
bin/mysql_install_db --user=mysql
chown -R root .
chown -R mysql var
chgrp -R mysql .
启动数据库
bin/mysqld_safe user=mysql &
改密码,yourpassword为你的新密码
mysqladmin -u root password yourpassword
设为服务:
cp support-files/mysql.server /etc/init.d/mysql.server chkconfig --add mysql.server 这样就可以通过 service mysql.server start 启动数据库 service mysql.server stop 关闭数据库
更改包大小:
默认是1M,WiKi导入超过1M的文件会出错。
vi /etc/my.cnf
更改max_allowed_packet = 1M为max_allowed_packet = 32M
创建XWiki的数据库:
mysql -u root -p
create database xwiki;
grant all privileges on xwiki.* to xwiki@127.0.0.1 identified by 'xwiki';
添加 hibernate.cfg.mysql.xml
cp hibernate.cfg.xml hibernate.cfg.mysql.xml
vi hibernate.cfg.mysql.xml
MySQL相关的内容为:
<!-- Default MySQL configuration
Comment it to use for HSQLDB or Oracle -->
<property name="connection.url">jdbc:mysql://localhost/xwiki?useServerPrepStmts=false</property>
<property name="connection.username">xwiki</property>
<property name="connection.password">xwiki</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="connection.provider_class">com.xpn.xwiki.store.DBCPConnectionProvider</property>
<property name="connection.pool_size">2</property>
<property name="statement_cache.size">25</property>
修改配置文件 xwiki.cfg
cd default/webapps/xwiki/WEB-INF/
vi xwiki.cfg
修改
xwiki.store.hibernate.path=/WEB-INF/hibernate.cfg.hsql.xml
为
xwiki.store.hibernate.path=/WEB-INF/hibernate.cfg.mysql.xml
Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1651474