doc: replace mysql with sqlite
This commit is contained in:
parent
d530af9677
commit
b6cc7ef060
21
README.md
21
README.md
|
@ -41,7 +41,7 @@ components
|
|||
|
||||
Part information is:
|
||||
|
||||
- stored in a MariaDB/mySQL database
|
||||
- stored in a sqlite3 database
|
||||
- retrieved using a sinatra HTTP/REST server
|
||||
- displayed using minimal HTML+JS pages
|
||||
|
||||
|
@ -51,25 +51,18 @@ installation
|
|||
install software dependencies (here for Arch linux):
|
||||
|
||||
~~~
|
||||
sudo pacman -S mariadb
|
||||
sudo pacman -S ruby-sinatra ruby-webrick
|
||||
pikaur -S ruby-mysql2
|
||||
sudo pacman -S sqlite ruby ruby-rake
|
||||
gem install json sqlite3 sinatra puma
|
||||
~~~
|
||||
|
||||
configure database
|
||||
create database
|
||||
|
||||
~~~
|
||||
sudo mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
|
||||
sudo mysql
|
||||
CREATE DATABASE partdb;
|
||||
CREATE USER 'partdb'@localhost IDENTIFIED BY 'password';
|
||||
GRANT ALL PRIVILEGES ON partdb.* TO 'partdb'@localhost;
|
||||
exit
|
||||
mysql --user=partdb --password=password --database=partdb < schema.sql
|
||||
sqlite partdb.db < schema.sql
|
||||
~~~
|
||||
|
||||
put the database access information in `credentials.json` and run `server.rb`.
|
||||
now just run `server.rb`.
|
||||
now go to http://localhost:4245 and you are ready to use it.
|
||||
the port is defined in `server.rb`.
|
||||
the port and database file is defined in `server.rb`.
|
||||
|
||||
use a proxy web server to handle the authentication, TLS, compression, ...
|
||||
|
|
Loading…
Reference in New Issue