• Home
  • Technology
    • Ebullientech
    • Entrepreneurship
    • Video Technology
    • Cloud Computing
    • Business Analysis
  • Healthcare
    • Pharmacology
  • Thoughts
    • Food
    • General
    • Stories
    • Places
    • Workplace
    • Social Issues
    • Reviews
  • Quotes
  • Ebullientech News and Events
  • About

Kamalika's Notebook

thinking nothing...............!!

A Few Useful MySQL Commands / Queries for Amateur DBAs – Part 1

February 4, 2013 By Kamalika Leave a Comment

MySQL DBA

I consider myself an amateur DBA because I’m not a professional MySQL DBA but at times I have to work with some MySQL Commands / Queries which are piece of cake for professional DBAs but require me to Google every time I need to use them. Currently some of them are lying in my GMail’s draft and some are lying in a Google Drive Doc and for the rest of them I still need to Google!! One Monday morning decided to create a ready reference out of those Commands / Queries and publish under my Blog for all future requirements and for other amateur MySQL DBAs out there in the World Wide Web!

1. Login to MySQL Command Prompt as root user

#mysql -uroot -p (this will require you to enter password after you press the return key)

OR

#mysql -uroot -prootpwd (here “rootpwd” is the password for root user)

Using the full MySQL Server path: /usr/local/mysql/bin/mysql -uroot -p OR /usr/local/mysql/bin/mysql -uroot -prootpwd

Pages: 1 2 3 4

Filed Under: MySQL, Server Administration Tagged With: MySQL, MySQL Commands, MySQL Queries

How to rename a stored procedure in MySQL?

February 1, 2013 By Kamalika Leave a Comment

how to rename a mysql stored procedureIf you have a situation in hand where you need to rename a STORED PROCEDURE in MySQL and not DROP it then there are 2 ways I could figure out to tackle it. Before I start describing the methods I would like to state why I needed to rename a STORED PROCEDURE in MySQL?

I always have a STORED PROCEDURE named as “x” in all my projects databases where I write temporary code to tackle a particular problem and when the experiment is successful I create a new STORED PROCEDURE and copy & paste code from “x” PROCEDURE. I was following this process for quite some time happily, but then came a situation where it looked time consuming and I needed a faster method!

I found Method 1 by Google-ing and Method 2 was my sudden discovery!

Method 1: Rename a STORED PROCEDURE

SET name = ‘<new_proc_name>’,
specific_name = ‘<new_proc_name>’
WHERE db = ‘<database>’ AND
name = ‘<old_proc_name>’;

So if I want to rename my “x” PROCEDURE to “new_x” the statement would look like the following:

UPDATE `mysql`.`proc`
SET name = ‘new_x’,
specific_name = ‘new_x’
WHERE db = ‘db_mydb’ AND
name = ‘x’;

Please Also note: If you have granted privileges to users for this procedure you will need to update the procedure name in procs_priv as well.

UPDATE `mysql`.`procs_priv`
SET Routine_name = ‘<new_proc_name>’
WHERE Db = ‘<database>’ AND
Routine_name = ‘<old_proc_name>’;

FLUSH PRIVILEGES;

You can execute the above queries from MySQL GUI Tool like MySQL Query Browser or MySQL Command Prompt.

Method 2: Rename a STORED PROCEDURE with a backup

This method is my sudden discovery and I figured it before I found Method 1 by Google-ing and I execute it in MySQL Query Browsers (needless to say it is still my favorite tool to operate MySQL!)

– Select the PROCEDURE “x” and press F2 or right click and select “Edit Procedure”

– PROCEDURE opens in the Query Browser Editor

– Modify DROP PROCEDURE IF EXISTS `db_mydbs`.`x` to DROP PROCEDURE IF EXISTS `db_mydbs`.`new_x`

– Modify CREATE PROCEDURE `db_mydb`.`x` () to CREATE PROCEDURE `db_mydb`.`new_x` ()

– Click to Continue button

The above steps create a new PROCEDURE named “new_x” and also keeps the PROCEDURE named “x” intact.

I generally use Method 2 because it lets me keep my handy “x” PROCEDURE intact and create another PROCEDURE with the same code in a mouse click. Method 2 may not sound very scientific or authentic but since MySQL respond to it quite nicely I guess it is not as bad :).

© Kamalika Guha Roy

Filed Under: MySQL Tagged With: How to rename a stored procedure in MySQL, Learn more about How to Rename a Database in MySQL, MySQL, MySQL STORED PROCEDURE, Rename a MySQL procedure

How To Deploy Ruby on Rails in Godaddy?

February 1, 2013 By Kamalika Leave a Comment

ruby on rails on godaddy

  1. Login to Godaddy Control Panel
  2.  Click on My Account
  3.  Click on Hosting
  4.  This page will display active domains that are hosted within that Godaddy hosting space
  5. Click on Manage (on whichever domain you want to deploy Ruby on Rails application/project)
  6. In the hosting manager click on CGI-Admin under Content section
  7. Login to CGI-Admin using your hosting account user name and password
  8. From Ruby tab create your Ruby/Ruby on Rails application directory
  9.  Above step will create a folder under hosting space and one .htaccess file under that folder
  10. Edit .htaccess file and change the file from despatch.cgi to despatch.fcgi
  11. Open a FTP client
  12. Download their demo application
  13. Create our controller, model, view in that demo application using ruby script generator
  14. Check it locally
  15. Upload the whole application (along with the rails distribution in the vendor folder) to the folder that created from CGI-Admin
  16. From browser the path will be http://www.mysite.com/<myapplication-folder>/public/<controller>/<action>

Filed Under: Networking, Server Administration Tagged With: How To Deploy Ruby on Rails in Godaddy?, Ruby on Rails Deployment in Godaddy

Creating Backup Schedule in RHEL 5

January 13, 2013 By Kamalika Leave a Comment

Creating Backup Schedule in RHEL 5

Creating Backup Schedule in RHEL 5:

  1. Open Putty
  2.  Login to the server (entering server IP)
  3. Login to server using user name and password from the Putty SSH Console
  4.  To create a CRON schedule type:crontab –e <enter>
  5. VI text editor will open as a blank file for the “crontab entries” to be entered; each line represents a separate crontab entry (hereafter referred to as “CRON JOBS”).
  6.  Each CRON JOB has at least 6 sections. Each section is delimited by a single blank space, but the final section may have spaces within it. No spaces are allowed within Sections 1-5, blank spaces are allowed only between those sections. Sections 1-5 are to indicate when and how often you want the task (the sixth position) to be executed and it uses the system time for execution.
  7.  Here is how positions 1-5 are laid out:

1 Minute 0-59
2 Hour 0-23 (0 = midnight)
3 Day 1-31
4 Month 1-12
5 Weekday 0-6 (0 = Sunday)
An asterisk (*) is used to indicate that every instance (i.e. every hour, every weekday, etc.) of the particular time period will be used.

  1. Backup script within the crontab entry is

 * 14 * * 5 root tar czpvf /home/user/backup-$(date +%Y-%m-%d).tar.gz /opt/lampp

 

  1. The CRON is set to 1400 hour (2:00 p.m.) 5th day of week (Friday)
  2. The command that will execute is
    tar czpvf /home/user/backup-$(date +%Y-%m-%d).tar.gz /opt/lamppThis above command will tar the entire content of the directory /opt/lampp and put the tar file into  /home/user/
    The name of the tar file will be backup-$(date +%Y-%m-%d).tar.gz (backup-YYYY-MM-DD.tar.gz)

Filed Under: Networking Tagged With: Creating Backup Schedule in RHEL 5

Pentago for iPhone

September 14, 2010 By Kamalika Leave a Comment

The Award Winning strategic Board game ‘Pentago’ now makes an exclusive addition on the Appstore for your iPhone & iPod Touch devices. With smooth and easy to play touch controls which will make your gameplay immersive and one awesome challenging experience. Play to beat the AI or throw a challenge to a friend on the same device with the ‘Pass n Play’ mode. Track your progress, flip themes, change board styles, and unlock medals. It takes a lot to be unbeaten; Are you up for the challenge? Then go play it for FREE on Facebook.

Filed Under: iPhone Tagged With: iPhone, iPhone Apps, MindTwister, Pentago, UTV Indiagames

  • « Previous Page
  • 1
  • …
  • 7
  • 8
  • 9
  • 10
  • 11
  • Next Page »

Let’s connect…

  • Facebook
  • Instagram
  • LinkedIn
  • Twitter
  • YouTube

Hello There…

I'm Kamalika, a techpreneur & startup mentor, blogger, hobbyist photographer, Netflix & Kindle indulgent, food connoisseur, Starbucks aficionado and former Disney employee ...next

Looking for something?

Tags

All in One SEO Pack AWS Banaras Blogger Blogging Blogs Dasaswamedh Ghat Ebullientech Ebullientech Interactive LLP Facebook Facebook Developers father's day father's day wishes father's day wishes for dad fathers day love Fathers Day Special Fathers Day wishes from daughter Father’s day memories GeoTech GeoTech Informatics HipHop for PHP Kamalika Guha Roy Kashi Ganga LAMP MySQL Nabaneeta Guha Roy Online Marketing PayPal PayPal's suspension of Indian bank transactions PHP PHP & MySQL Saraswati Puja Search Engine Optimization SEO Startup The Ganges TypePad UCO HUT Varanasi Web 2.0 Web 2.0 Design Web Design Web Marketing WordPress WordPress.COM

Timeline

  • 2024 (1)
  • 2021 (3)
  • 2020 (7)
  • 2019 (4)
  • 2018 (1)
  • 2015 (6)
  • 2014 (13)
  • 2013 (9)
  • 2010 (7)
  • 2009 (2)

Topics

Copyright © 2021 · Kamalika Guha Roy, Powered by: Ebullientech