<commit_before>#!/bin/bash

# NOTE: THIS FILE IS INTENDED TO BE USED BY THE DOCKER INSTANCE ONLY

# Start MySQL
service mysql start

# Create DB
echo "DROP DATABASE FreeSource;" | mysql -u root --password=$FS_PASS 2>/dev/null
echo "CREATE DATABASE FreeSource;" | mysql -u root --password=$FS_PASS 2>/dev/null

# Create user with full permissions
echo "CREATE USER 'teamace'@'localhost' IDENTIFIED BY 'freesource'; FLUSH PRIVILEGES;" | mysql -u root --password=${FS_PASS} 2>/dev/null

# Alter user permissions
echo "GRANT ALL ON *.* to teamace@localhost;" | mysql -u root --password=$FS_PASS 2>/dev/null

# Initialize database
echo "Initializing database..."
echo "USE FreeSource; source Freesources_demo1.sql;" | mysql -u root --password=$FS_PASS FreeSource 2>/dev/null

# Make database migrations before running project (in case model updated)<commit_msg>Modified docker_init.sh to hopefully address mysql timeout issue<commit_after>#!/bin/bash

# NOTE: THIS FILE IS INTENDED TO BE USED BY THE DOCKER INSTANCE ONLY

# Stop mysql service if running
service mysql stop
rm -f /var/lib/mysql/ib_logfile0
rm -f /var/lib/mysql/ib_logfile1

# Start MySQL
service mysql restart

# Create DB
echo "DROP DATABASE FreeSource;" | mysql -u root --password=$FS_PASS 2>/dev/null
echo "CREATE DATABASE FreeSource;" | mysql -u root --password=$FS_PASS 2>/dev/null

# Create user with full permissions
echo "CREATE USER 'teamace'@'localhost' IDENTIFIED BY 'freesource'; FLUSH PRIVILEGES;" | mysql -u root --password=${FS_PASS} 2>/dev/null

# Alter user permissions
echo "GRANT ALL ON *.* to teamace@localhost;" | mysql -u root --password=$FS_PASS 2>/dev/null

# Initialize database
echo "Initializing database..."
echo "USE FreeSource; source Freesources_demo1.sql;" | mysql -u root --password=$FS_PASS FreeSource 2>/dev/null

# Make database migrations before running project (in case model updated)
{'fraction_non_alphanumeric': 0.11046202867764206, 'fraction_numerical': 0.007434944237918215, 'mean_word_length': 4.657657657657658, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5165919', 'n_tokens_mistral': 603, 'n_tokens_neox': 578, 'n_words': 216}