Skip to main content

Posts

Showing posts from May, 2008

SQL, Report Generation Processs

Step 1. Export SQL result in to an csv file Step 2. Report Validation ( Through Excel ) ------------- The lifeline for any business intelligence solution is the process called extract, transform, and load (ETL). According to a recent survey by The Data Warehousing Institute (TDWI), ETL design and development work consumes 60 to 80 percent of the resources of an entire BI project. Selecting an ETL solution that fits your needs is an essential first step in building a successful data warehouse.

Exporting MySQl result set to ...

CSV File : sudo echo " select * from accountMaster" | mysql -u username -p database > accounts.txt; TEXT FILE: sudo echo " select * from accountMaster" | mysql -u username -p database > accounts.txt; MAIL : sudo echo "select * from campaignMaster" | mysql -u username -p database > "campaigns.txt" | mail xyz@pintoodomain.com :-)

DBI connection

Error: DBI connect('database :','username',...) failed: Access denied for user 'username'@'localhost' (using password: YES) at COMPLETE_PATH_PROGRAM.pm line 41 couldn't connect to database: Access denied for user 'username'@'localhost' (using password: YES) at COMPLETE_PATH_PROGRAM.pm line 41.. Explanation: This error occurred because password provided to MySql by perl was containing special characters ..like '@' with in double quotes (which looked like password ="@ll3" ) any special char mentioned inside in double quotes is converted to its original. so I changed it to password ='@ll3' to resolve the issue. any string inside " " looks for phrase match. any string inside ' ' looks for exact match.

Adding New User Accounts to MySQL

Step 1 - Create new MySQL user MySQL create user Nowadays security is more and more important even in case of smaller websites. As a lot of site uses some database so this is one point where we can make some improvements. In this article we will work with MySQL on our goal is to create a new user in the database. There are more ways how you can do this. Using CREATE USER and/or GRANT commands Inserting a new record into the mysql.user table First let's see how to use the CREATE USER command. Here I have to mention that thi s command is available only in MySQL 5 (5.0.2) and newer releases. The syntax is the following: CREATE USER user [IDENTIFIED BY [PASSWORD] ' password '] Here is an example: Code: CREATE USER 'user1' @ 'localhost' IDENTIFIED BY 'pass1' ; Database F1 Now if you check the mysql.user table you can find a new record in it. Notice that all priviliges are set to No so this user can do nothing in the DB. To add some preiviliges w

Problem faced while doing SSH

Error Encountered : @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be eavesdropping on you right now (man-in-the-middle attack)! It is also possible that the RSA host key has just been changed. The fingerprint for the RSA key sent by the remote host is 74:ed:09:3c:46:1f:5f:8a:8a:86:d5:80:6b:6e:e4:75. Please contact your system administrator. Add correct host key in /home/USERNAME/.ssh/known_hosts to get rid of this message. Offending key in /home/USERNAME/.ssh/known_hosts:3 RSA host key for 192.168.0.48 has changed and you have requested strict checking. Host key verification failed. Solution : vi /home/USERNAME/.ssh/known_hosts and just delete the contents of the file completely, to get rid of old keys which no longer exist, or turn off strict checking in your SSH configuration as the e

Perl POP Connection

Problem : Program couldnt make connection to the mail server. Solution: changed USESSL=>0 to USESSL=>true Explanation: If you pass a true value for USESSL, the port will be changed to 995 if it is not set or is 110. Otherwise, it will use your port. If USESSL is true, IO::Socket::SSL will be loaded. If it is not in your perl, the call to connect will fail. new returns a valid Mail::POP3Client object in all cases. To test for a connection failure, you will need to check the number of messages: -1 indicates a connection error. This will likely change sometime in the future to return undef on an error, setting $! as a side effect. This change will not happen in any 2.x version. Source : http://search.cpan.org/~sdowd/Mail-POP3Client-2.16/POP3Client.pm