Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CRIO_BYTES
SELENIUM
me_jmeter
Commits
e8d45a88
Commit
e8d45a88
authored
2 years ago
by
Simran Kumari
Browse files
Options
Download
Email Patches
Plain Diff
Update sql_config.sh
parent
fcc568e3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
sql_config.sh
sql_config.sh
+29
-0
No files found.
sql_config.sh
0 → 100644
View file @
e8d45a88
#!/bin/bash
sudo
mysql
<<
BASH_QUERY
# start of sql query
CREATE USER 'sqluser'@'%' IDENTIFIED WITH mysql_native_password BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'sqluser'@'%';
FLUSH PRIVILEGES;
# create an sql user and add priviliges
CREATE DATABASE db_testing;
USE db_testing;
# create database
CREATE TABLE carmodels (
year INT NOT NULL,
make VARCHAR(255) NOT NULL,
model VARCHAR(255) NOT NULL
);
# within the database create table
LOAD DATA LOCAL INFILE '/home/crio-user/workspace/bytes/me_jmeter/car-model.csv'
INTO TABLE carmodels
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '
\n
'
IGNORE 1 ROWS;
# load data into the created table from the csv file.
# Ignore 1st row as it contains column headings
# csv file has value separated by `,`
SELECT COUNT(*) FROM carmodels;
# returns the number of rows in the created table
# end of sql query
BASH_QUERY
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment