- Create and activate virtual environments venv
- Install Flask
pip istall flask
- if use MySQL:
pip install mysql-connector-python
- if use MySQL:
- Install MariaDB MariaDB Server
- Install MariaDB Connector Python Connect
- Connect to the MariaDB and create database vsearchlogDB:
CREATE DATABASE vsearchlogDB;
- Create the new database user:
grant all on vsearchlogDB.* to 'vsearch'@'localhost' identified by '{{password}}';
and quit from MariaDB mysql -u vsearch -p vsearchlogDB
- Create table:
CREATE TABLE log (
id int auto_increment primary key,
ts timestamp default current_timestamp NOT NULL,
phrase varchar(128) NOT NULL,
letters varchar(32) NOT NULL,
ip varchar(16) NOT NULL,
browser_string varchar(256) NOT NULL,
results varchar(64) NOT NULL);
- Check created table:
describe log;
- Display data in log table:
SELECT * FROM vsearchlogdb.log;