Permalink
Browse files

character set fixes

  • Loading branch information...
1 parent 32b7175 commit 5aeb42caced3248ec8aab8b3bdceabbff80a5497 @tomclegg tomclegg committed Nov 17, 2010
Showing with 34 additions and 1 deletion.
  1. +5 −0 README
  2. +12 −1 README-restore
  3. +1 −0 install
  4. +5 −0 mysql-utf8.cnf
  5. +11 −0 setup
View
@@ -53,6 +53,11 @@ Install and enable wikifarm
sudo a2ensite wikifarm
sudo /etc/init.d/apache2 restart
+Change your default mysql character set to utf8
+
+ sudo cp /etc/wikifarm/mysql-utf8.cnf /etc/mysql/conf.d/utf8.cnf
+ sudo /etc/init.d/mysql restart
+
Create an administrator account
* Visit http://{your.wiki.farm}
View
@@ -32,10 +32,21 @@ Extract the backup tarball in /tmp.
cd /tmp
tar xzf /path/to/tarball/$restore.tar.gz
+Uncompress the database:
+
+ gunzip $restore/private/wikidb*.sql.gz
+
+It might be necessary to convert character encodings like this:
+
+ perl -ni~ -e '
+ do { s/latin1_bin/utf8_unicode_ci/g; s/latin1/utf8/g }
+ unless /^INSERT/
+ ' $restore/private/wikidb*.sql
+
Import the database (you will be prompted to enter your root
password).
- zcat $restore/private/wikidb*.sql.gz | mysql -u root -p wikidb$wikiid
+ cat $restore/private/wikidb*.sql | mysql -u root -p wikidb$wikiid
Copy the images directory.
View
@@ -35,6 +35,7 @@ install $SOURCEDIR/DefaultFarmSettings.php $DESTDIR$WWW/
install $SOURCEDIR/serverlogo.png $DESTDIR$WWW/serverlogo.png.example
install $SOURCEDIR/favicon.ico $DESTDIR$WWW/favicon.ico.example
install $SOURCEDIR/config.php.example $DESTDIR$ETC/
+install $SOURCEDIR/mysql-utf8.cnf $DESTDIR$ETC/
make -C $SOURCEDIR
install $SOURCEDIR/textile-2.0.0/classTextile.php $DESTDIR$WWW/
View
@@ -0,0 +1,5 @@
+[client]
+default-character-set = utf8
+[mysqld]
+character_set_server = utf8
+collation_server = utf8_unicode_ci
View
@@ -65,3 +65,14 @@ if apache2ctl configtest
then
/etc/init.d/apache2 restart
fi
+
+if [ ! -e /etc/mysql/conf.d/utf8.cnf ]
+then
+ cat <<EOF
+
+*** I recommend installing $ETC/mysql-utf8.cnf into
+*** /etc/mysql/conf.d/utf8.cnf and restarting mysql before creating
+*** any databases.
+
+EOF
+fi

0 comments on commit 5aeb42c

Please sign in to comment.