03. Installing and populating the mysql database - findsorguk/findsorguk GitHub Wiki
After installing the source code, you now need to install and populate the MySQL database.
- Create your database with utf8-unicode-ci as the collation to ensure all the character sets work properly.
- Within the source code folder for the project you will find a folder labelled SQL. You will need to import the file named database.sql. This creates the structure for the database.
- After running this, you will need to import the dropdown structure and lookup tables for the project. So you now need to import the file labelled populateTables.sql. This is quite large, so you may need to do this via the command line interface.
For example:
mysql -u username -p
At the command prompt type (replacing databasename with an appropriate name):
CREATE DATABASE databasename CHARACTER SET utf8 COLLATE utf8_general_ci;
quit
Then import data:
mysql -u username -p databasename < database.sql
mysql -u username -p databasename < populateTables.sql
You should create a user with the correct privileges for the database and use this. Do not run as root user. If using the solr dataimporter, you should create a user with SELECT privileges only.
If these commands run successfully, you will now have the database structure. You now need to [configure the variables](https://github.com/findsorguk/findsorguk/wiki/04. Configuring-the-system) for the site to run.