A service for indexing and finding media (photos, video, music, etc.) easily.
- See https://dev.mysql.com/doc/refman/8.0/en/installing.html for more details, but if you're on a system that has a package manager, this should be pretty simple to do. On MacOS for example, you should be able to just use
brew install mysql
(see https://brew.sh)
- Edit your mysql.cnf file to allow TCP connections by changing the
bind-address
. The file is typically found in the/etc/mysql/
directory, but can be different depending on your package mangager or how you installed it. Find the sectionmysqld
and ensure thebind-address
looks like the following:
[mysqld]
bind-address = 0.0.0.0
- Initialize (see https://dev.mysql.com/doc/refman/8.0/en/automatic-start.html and https://dev.mysql.com/doc/refman/8.0/en/starting-server.html), connect, and set a root password:
This assumes there is no data folder setup at all. If there is one, you can skip the
sudo
command.
sudo mysqld --initialize-insecure --user=$(whoami) &
mysqld &
mysql -u root --skip-password
alter user 'root'@'localhost' identified by 'root-password';
- Create the database schema:
create database mediafinder;
- Create a user with a password (remember for later):
create user 'mediafinder'@'%' identified by 'password';
- Grant permissions to the new user:
grant all on mediafinder.* to 'mediafinder'@'%';
- Exit:
exit
- Set the mediafinder database password environment variable to the password from 4:
export MEDIAFINDER_PW=password
You can add this to your bashrc as well, so you don't have to do it again after restarting your shell:
echo 'export MEDIAFINDER_PW=password' >> ~/.bashrc
- Restart MySQL server:
sudo mysqladmin -u root -p shutdown
sudo mysqld &
- Connect to test:
mysql -h127.0.0.1 -umediafinder -p
- Show the databases available to the
mediafinder
user. It should have access to themediafinder
schema:
show databases;
- Exit:
exit
- Probably easiest to just follow https://www.elastic.co/guide/en/elasticsearch/reference/current/install-elasticsearch.html. Elasticsearch comes with its own JDK, so it isn't necessary to have a paricular version installed.
- Onces the server is up you should be able to go to http://localhost:9200 and see the information about the instance.
- Either use a package manger (like brew) to install and configure JDK 16 or download it directly from https://jdk.java.net/16/. The following steps assume you are downloading it and installing it manually.
- Navigate to a directory you want to keep the JDK in:
cd ~
- Download JDK 16 for your OS: MacOS
wget https://download.java.net/java/GA/jdk16/7863447f0ab643c585b9bdebf67c69db/36/GPL/openjdk-16_osx-x64_bin.tar.gz
Linux
wget https://download.java.net/java/GA/jdk16/7863447f0ab643c585b9bdebf67c69db/36/GPL/openjdk-16_linux-x64_bin.tar.gz
- Extract the files:
tar xvf openjdk-16_*.tar.gz
- Navigate to the directory:
cd openjdk-16_*
- Export the JDK bin PATH and set JAVA_HOME:
echo 'export PATH="'$(pwd)'/bin:$PATH"' >> ~/.bashrc
echo 'export JAVA_HOME="'$(pwd)'"' >> ~/.bashrc
source ~/.bashrc
- The following should return references to java 16:
java -version
- Go to a projects directory of your choosing
- Clone the repo
git clone https://github.com/kiLLeen/mediafinder.git
cd mediafinder
- Build the application
./gradlew clean build jar
java -jar ./build/libs/mediafinder-*.jar