Read Text file and insert only unique ones into mysql table

Suoritettu Julkaistu 6 vuotta sitten Maksettu toimituksen yhteydessä
Suoritettu Maksettu toimituksen yhteydessä

DO NOT BID THIS PROJECT IF YOU DON'T HAVE SSH ACCESS TO YOUR LINUX SERVER

PROJECT BUDGET $30

I WANT TO CREATE BASH SCRIPT BELOW TO BE ABLE TO INSERT THINGS IN TXT TO MYSQL TABLE

I would like to insert URL's in [login to view URL] text file into mysql database table called 'banned_url_links' There is also different characters in URL's e.g.(" ' " and " \ ") all urls should be inserting to mysql as it is. I would like this script to check duplicate URL's in mysql column name 'links' and insert only unique ones ([login to view URL] text file is removed and and creating new links everyday, therefore duplicate checks has to be against mysql table not on text file). I want also inserting date for each records (I already done on mysql side but I am not sure it will work without sending date to mysql). My database structure, [login to view URL] and bash script are below.

MYSQL table structure

Table (banned_url_links) structure

1 ID int(10) No None AUTO_INCREMENT

2 date timestamp No CURRENT_TIMESTAMP

3 links varchar(300) utf8_general_ci No None

My bash script just for reference I want bas script this way so I can change easily db variables.

#!/bin/bash

host="1.1.1.1";

DBName='wpmy_db';

DBUser='wp_myuser';

DBPass='137T321uS&*3j5';

File=[login to view URL];

MYSQL="mysql -u$ DBUser -p$ $DBName DBPass -h $host";

echo $MYSQL;

$MYSQL -e "INSERT INTO banned_url_links SET links = $File";

$MYSQL LOAD DATA INFILE '[login to view URL]' INTO TABLE [login to view URL];

EOF

Tietokannan hallinto Linux MySQL PHP UNIX

Projektin tunnus: #15572128

Tietoa projektista

9 ehdotusta Etäprojekti Aktiivinen 6 vuotta sitten

Myönnetty käyttäjälle:

gangabass

I can create Perl or Python or PHP script (sorry but Bash will be not so flexible) in couple of hours that will work exactly like you want: parse [login to view URL] and insert records in MySQL. Relevant Skills and E Lisää

$30 USD 1 päivässä
(399 Arvostelua)
7.4

9 freelanceria on tarjonnut keskimäärin $64 tähän työhön

wpmonsters

Hello, Let me introduce WordPress Monsters, the team which aims at building the best WP products and often succeeds in doing that. We're trully comfortable working with WordPress website development. We use WP to build Lisää

$350 USD 3 päivässä
(23 arvostelua)
5.5
SammyOpiyo

Write a python script to check for links and insert into mysql if the links do not occur in the database. Relevant Skills and Experience python, mysql, re, paramiko, file handling Proposed Milestones $30 USD - Write Lisää

$30 USD 1 päivässä
(14 arvostelua)
4.8
anilprasad4352

Bash script for unique value insertion into table from txt file Relevant Skills and Experience Bash, Script, SSH, Database,Mysql Proposed Milestones $30 USD - Default

$30 USD 1 päivässä
(20 arvostelua)
4.0
Lultu

Have developed a small PHP portal to upload CSV files to insert into MySQL table banned VOIP numbers. I guess it will be easier than using bash script. Relevant Skills and Experience PHP, MySQL Proposed Milestones $2 Lisää

$25 USD 1 päivässä
(15 arvostelua)
3.8
Ankit1007

Dear sir, I have a team of expert developer and designer who can give make any kind of application with their skill set. Relevant Skills and Experience I have seen requirements and I am 100 % sure that I can make i Lisää

$25 USD 1 päivässä
(7 arvostelua)
2.9
nyandenisap

A proposal has not yet been provided

$35 USD 3 päivässä
(0 arvostelua)
0.0