ljr/livejournal/doc/raw/lj.book/install/mysql_setup.xml

73 lines
3.2 KiB
XML
Raw Permalink Normal View History

2019-02-05 21:49:12 +00:00
<chapter id="lj.install.mysql_setup">
<title>MySQL</title>
<abstract><para>
There are a few simple reasons why we chose MySQL when picking a database backend for LiveJournal:
It's <ulink url="http://www.mysql.com/information/benchmarks-old.html">fast</ulink>,
<ulink url="http://www.mysql.com/doc/en/Using_the_MySQL_software_for_free_under_GPL.html">free</ulink>,
<ulink url="http://www.mysql.com/doc/en/Stability.html">stable</ulink>,
<ulink url="http://www.mysql.com/doc/en/Privilege_system.html">secure</ulink>, and well supported
by a large community of users. In this chapter we'll deal with installing and setting up MySQL on
your server, then we'll show you how to populate your installation with the required base data.
</para></abstract>
<section id="lj.install.mysql_setup.install">
<title>Install MySQL</title>
<para>
LiveJournal requires a MySQL install of at least version 3.23.x,
but highly recommends installing the latest stable release that is
available, expecially if you're going to need clustering and
replication abilities.
</para>
<para>
MySQL offers binaries for many operating aystems, including Win32
and several different <quote>flavors</quote> of Unix.
Installations on any of these systems should be fairly easy, as
most offer a simple installation program that guides you through
setup.
</para>
<tip><title>Debian</title>
<simpara>The MySQL server package for Debian is <filename>mysql-server</filename>.</simpara>
</tip>
</section>
<section id="lj.install.mysql_setup.create_db">
<title>Create the LiveJournal Database</title>
<para>
Login to MySQL as the root MySQL user and create the database that
will hold the LiveJournal data:
</para>
<screen><prompt>$</prompt> <userinput>mysql -uroot -p</userinput>
<prompt>mysql></prompt> <userinput>CREATE DATABASE livejournal;</userinput>
<prompt>mysql></prompt> <userinput>GRANT ALL PRIVILEGES ON livejournal.* TO </userinput>
<prompt> ></prompt> <userinput>lj@'localhost' IDENTIFIED BY 'ljpass';</userinput></screen>
<para>
If you know what you're doing, you can set this up however you
like. You tell LiveJournal how to connect to its database server(s)
in your <filename>ljconfig.pl</filename>, as
detailed in: <xref linkend="lj.install.ljconfig.dbinfo" />.
</para>
</section>
<section id="lj.install.mysql_setup.pop_db">
<title>Populate the Database</title>
<para>
In order to use your site, you're going to need to populate your MySQL
database with the required information to get the service started.
</para>
<screen><prompt>$</prompt> <userinput>cd <envar><link linkend='lj.install.ljhome'>$LJHOME</link></envar></userinput>
<prompt>$</prompt> <userinput>bin/upgrading/update-db.pl --runsql --populate</userinput>
<prompt>$</prompt> <userinput>bin/upgrading/texttool.pl load</userinput></screen>
<para>
That'll bring your database schema up-to-date and populate it with any
look-up data it needs.
</para>
</section>
</chapter>
<!--
Local Variables:
mode:sgml
sgml-parent-document: ("index.xml" "part" "chapter")
End:
-->