2
votes
1answer
53 views

Mysql synonym drop and create

I am running into the issue that, when the script is run, the MySql section of it isn't working or is droping the synonym. Is there something else i need to put into the command to have it log into ...
0
votes
1answer
33 views

how can I replace a record in my DB (mySql) by new record?

I have created a shell script to connect to a DB and INSERT IPs and MACs from dhcpd.log file: #/!bin/bash dhcpLogFile="/var/log/dhcpd.log" NumberOfLines=$(awk '/DHCPACK/ { print $8} ' $dhcpLogFile | ...
1
vote
2answers
47 views

Is it secure to connect remotly to Mysql using shell?

I have created a shell script to connect to a DB and do some queries: #/!bin/bash ... ... mysql -h remote -u root --password='pw' MatchingDB some SQL queries My question is : Is this connection ...
0
votes
1answer
33 views

how to ignore a MySql error and go on to the next query?

I have created a shell script to connect to a DateBase and INSERT IPs and MACs from dhcpd.log file by connecting to the DB only once: #/!bin/bash dhcpLogFile="/var/log/dhcpd.log" NumberOfLines=$(awk ...
2
votes
1answer
61 views

how to Connect to Mysql only once?

I have created a shell script to connect to a DB and INSERT IPs and MACs from dhcpd.log file the scripts worked properly: #/!bin/bash #Defining Variables dhcpLogFile="/var/log/dhcpd.log" #Begin Code ...
1
vote
1answer
85 views

how to check if mysql table is used or an application accesses the table in shell script?

A shell script is doing dump for a mysql table, but before dumping the table I want to check if this table is used by any other application. If so, I want to wait and enter in a loop until the ...
3
votes
2answers
3k views

Mysql query resultset in bash script

I am using the bash script to connect to the mysql database and execute a query. I use the below script to connect to the database and execute the query. #!/bin/bash Total_Results=$(mysql -h ...
0
votes
1answer
520 views

MySql not accessible by root user

I have a local MySql server. It is started as I can access it with my local user like $ mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 66 Server version: ...
0
votes
2answers
850 views

Cron job not running / not successful?

I have a couple of cron jobs set up to maintain a local copy of a remote database. The first one downloads the latest version of the database from the remote machine, which runs every day and is ...
0
votes
1answer
186 views

How to use a password as an external variable in shell?

I have this MySQL backup script that I use to back up MySQL databases. Very useful, and it runs on fixed intervals using a cron. However, I need somehow provide this script with the MySQL password. ...
5
votes
5answers
875 views

Multiple ssh sessions in single command

I'm trying to copy a database from one server to another. I tried using the following command and it's getting tied up on entering the ssh passwords. If I put in one server's password, it complains ...
5
votes
4answers
1k views

Selinux is denying access to mysqld

I have a script that dumps a mysql database. It then compresses the file and this gets stored in my home folder by using cron. The problem is I seem to be getting an error message. mysqldump: ...