Korn Shell and MySql Primer Tutorial

Korn Shell and MySql Primer Tutorial

Korn Shell and MySql Primer Tutorial

A few days ago we talked about the great “Fred and Ginger” type of relationship PHP and MySql have with Apache web servers, in particular, with WordPress Upgrade Crontab Curl Tutorial.

Well, even Fred and Ginger had a bust up or two, so we’re not here to welcome a bust up, just to show the independence of MySql as a database tool.

The thing is, MySql can live with just Linux or Unix shell scripting, or with other languages also, and we show that a bit today, by showing a subset of the functionality of the previously discussed WordPress Upgrade Crontab Curl Tutorial functionality just using a Linux web server Korn Shell environment calling on MySql command line usage.

Admittedly, this is a bit beside the point, because we query (and join) two WordPress (.org) databases, and, as you know, or would glean by being an avid reader of this blog, WordPress is PHP and MySql itself. However, the possibilities are there to …

  1. install MySql on a Linux or Unix system
  2. create some database tables to a job specification of interest either programmatically (with Korn Shell, for example) or using the MySql command line, or perhaps (to cheat our mostly non-GUI feel today) use the preposterously humorous, engagingly intuitive, curiously avante gard, absorbingly refreshing, and the (oh all right you asked for it) curiously refreshing “phpMyAdmin” to do this
  3. write shell scripts (eg. Korn Shell) to query and manipulate the MySql database via command line MySql functionality (as we do today)

So, who’s been left out of the equation out of Fred and Ginger? I’d hate to say. Who’s really up front and loud, rather than behind-the-scenes and reliable, as databases tend to be?

Who’s getting sidetracted sidetracked man person?

Oh, THEM … okay then … but seriously, when you tackle a job with data, you need to weigh up some considerations …

  • Is it a big data job now, or into the future? If yes, then this is better as a database job of some sort, rather than resorting to file systems of the web server you are on. If not, then it is overkill, in my opinion, to use a database like MySql, as it contributes highly to the load on your web server.
  • Is the data hierarchical by nature? If yes then a relational database like MySql could do well, with a good design, that uses indexes on (ideally integer) numerical indexes.
  • Will you need to be able to transport the solution to some other system that could be vastly different? Again, here, we wonder whether there is a lot of data, and if the answer is “No” then you should just adopt a web server file arrangement of some sort to best have the chance of an easy handover to another system. However, if there is some several megabyte size to the project with data, then the next best approach is to research what database works quite well in both operating system environments you are expecting.

Will leave you today with the Korn Shell script to query the two WordPress databases here for those mismatch “?p=[postId]” scenarios we talked about with WordPress Upgrade Crontab Curl Tutorial (and just writing for the first solution of the two solution ideas mentioned there), and you could call this code old_new_wp_mismatch_id.ksh if you like … but if you are feeling ornery and objectionable … can we recommend a session with the preposterously humorous, engagingly intuitive, curiously avante gard, absorbingly refreshing, and the curiously refreshing “phpMyAdmin” … just to lift the spirits … ahhhhhhhlll drink to that!

The way the code handles the MySql username’s password is to store it in a file outside the scope of the web server’s Document Root to put off “prying eyes”. There is a lot more you could do regarding encryption thoughts here, and with MySql command line it is not recommended to use its -p [password] switch, but rather interactively ask for the password, and that is effectively what we are doing by redirecting the MySql interactive input to this file outside the web server’s Document Root.

If this was interesting you may be interested in this too.

This entry was posted in Database, eLearning, Operating System, Projects, Tutorials and tagged , , , , , , , , , , , , . Bookmark the permalink.

11 Responses to Korn Shell and MySql Primer Tutorial

  1. I read this piece of writing fully concerning the comparison of hottest and
    preceding technologies, it’s amazing article.

  2. Thank you a bunch for sharing this with all men and women you genuinely recognize what that you are speaking about! Bookmarked. Kindly moreover talk about with my web site =). We will possess a link alternate contract amongst us!

  3. I am glad to be one of many visitants on this outstanding internet site (:, appreciate it for posting .

  4. Hello! I just wish to give a huge thumbs up for the good information you’ve gotten appropriate here on this post. I will likely be coming back to your weblog for far more soon.

  5. I do accept as true with all the ideas you’ve offered to your post. They’re very convincing and will certainly work. Nonetheless, the posts are very quick for starters. May you please lengthen them a little from next time? Thanks for the post.

  6. I simply wanted to type a small comment so as to thank you for the great suggestions you are sharing at this website. My extensive internet lookup has finally been paid with really good concept to talk about with my family. I would repeat that we readers are undoubtedly endowed to dwell in a magnificent website with so many marvellous individuals with interesting pointers. I feel truly grateful to have come across your website page and look forward to many more awesome times reading here. Thanks a lot again for a lot of things.

  7. obviously like your web site however you have to test the spelling on quite a few of your posts. Many of them are rife with spelling problems and I find it very bothersome to tell the truth however I’ll definitely come again again.

  8. Marcelo says:

    I think this is among the so much significant information for me.
    And i’m satisfied studying your article. But should statement on few general
    issues, The site taste is ideal, the articles is in point of fact great :
    D. Just right task, cheers

  9. blog says:

    What’s up colleagues, its fantastic article concerning tutoringand entirely explained, keep it up all the time.

  10. www says:

    Hey I am so glad I found your site, I really found you by
    mistake, while I was researching on Bing for
    something else, Nonetheless I am here now and would
    just like to say thanks for a marvelous post and a all round enjoyable blog (I also love the
    theme/design), I don’t have time to read through it all
    at the moment but I have saved it and also added your RSS feeds, so when I have time I will be back
    to read a great deal more, Please do keep up the superb work.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>