Skip to main content

Posts

Database Issues

1. root user can grant privileges to other user so you need to login as mysql -u , before granting privileges ... GRANT ALL PRIVILEGES ON database.* to cruncher@localhost identified by "password" 2. create database IF NOT EXISTS indiagATpincampaignsDOTcom ; ERROR 1044 (42000): Access denied for user 'cruncher'@'localhost' to database 'indiagDOTcom' Reason : I did ... " grant all privileges on *.* to cruncher identified by "password" ; " instead of grant all privileges on *.* to cruncher@localhost identified by "password" ;

Unzip on Perl

Problem: A uncompression module ( IO::Uncompress::AnyUncompress ) started giving problem in my new machine. which was working fine on old server. Solution: Installed IO::Uncompress::Unzip qw(unzip $UnzipError) from cpan and used, use IO::Uncompress::Unzip qw(unzip $UnzipError) ; unzip $infileName => $outfileName or die "unzip failed: $UnzipError\n"; which worked fine. Original machine (Server ): Linux dev 2.6.20-16-server #2 SMP Tue Feb 12 05:48:21 UTC 2008 i686 GNU/Linux ( uname -a) New machine (Server): Linux datacruncher 2.6.24-16-server #1 SMP Thu Apr 10 13:58:00 UTC 2008 i686 GNU/Linux

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