Connecting to MySQL server in a script returns error, but it works fine in a terminal
I’m trying to write a bash script which will install and set up a MySQL server automatically. The problem is that when my script executes the following command:
I’m trying to write a bash script which will install and set up a MySQL server automatically. The problem is that when my script executes the following command:
The output of my sql query has multiple columns and contains string values which contains space. I need to write bash script where in i have to read values into variable and then use it further in the script also insert them into another database.
I have the below script doing nightly backups of my databases. If I execute directly via shell, everything works. However, if via cron as same user execution, I get this error in the log file: nightly-backups.sh: 9: [[: not found 1 2 timestamp=`date +%Y-%m-%d`; 3 4 ##### EXECUTE THE MYSQL BACKUP ##### 5 echo "Starting … Read more
In html file, I need to replace only the first occurrence of:
I’m trying to save multiple columns in bash arrays with one query, but I can’t figure it out.
Now I have 3 SELECTs like this:
I’m needing to set some text into a field within a row, and use a SQL variable as part of that text. I’m then using this sql statement in a bash script.
Edited :
I have 180 flat files with multidimentional array (each file has 300 columns & 300 rows separated by space)
When I tried running the following command on MySQL from within Terminal:
How do I write a script to install MySQL server on Ubuntu?
I need a variable to hold results retrieved from the database. So far this is basically what I’m trying with no success.