You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
python -m pip install protobuf==3.6.1 : Install a particular version of protobuf
Create Database and Tables
We can login to MySQL prompt by using the below command.
mysql -u root -p : username is root, and it will ask for password, which we might have given during the installation of MySQL.
create database vsearchlogDB; : Create the database.
GRANT ALL PRIVILEGES ON * . * TO 'vsearch'@'localhost'; grants vsearch user all access to the database.
Till now everything was happening with root user, now we will use the vsearch user to create database.
mysql -u vsearch -p vsearchlogDB : login as vsearch user for the vsearchlogDB.
We need to create table called log.
createtablelog(id int auto_increment primary key,
ts timestamp default current_timestamp,
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);
describe log : show the table information.
DB-API connection to Database
DB-API - Define Connection
These 4 information is required while connecting toe the MySql DB.
The IP address/name of the computer running the MySql Server.
The user ID to use.
The password associated with the user ID.
The name of the database the user ID wants to interact.
These 4 information can be stored in a dictionary and passed onto while creating connection.