When you need to take a backup of a large MySql database, then “mysqldump” command come most handy and does the task in few seconds. But for that we need to access the web server or database through SSH. And database access in 99% cases is not allowed from remote location for security reasons.
I found myself in such situation recently and PhpMyAdmin export feature was not working due to script timeout or memory issues. So I googled for this and after 15-20 minutes of searching I found this very useful and working small script for the job.
$User = ""; // Put New user -- CPanel user or MySQL user with All permissions is fine.
$Password = ""; // Put New Password
$DatabaseName = ""; // Put Database name
$File = ""; // Put the complete path here -- /home/user/database.sql for example
$Results = shell_exec( "mysqldump --allow-keywords --opt -u$User -p$Password $DatabaseName > $File");
Just upload the file on the web server and execute it. Do remember to specify the path of the file so that it is accessible from the web e.g. provide any path which is inside public_html or www folder on most servers.
It will take just few seconds for 300-400MB database and then you can download the file and use it as you like.
Many times it is needed to save excel sheet as Comma Separated Value (CSV) text file to import in the MySql database. Usually when you save file as CSV file the fields are separated by “,”; but sometimes this causes problems in field separation if the content also contains comma.
To define a unique field for your CSV file field separator in your Windows Vista/XP systems, follow the following steps:
- Open control panel.
- Open “Regional and Language Options”.
- In “Formats” tab click “Customize This format”.
- Then in the list separator text box enter the desired field separator and click “ok”.
- Click “Ok”.
Now when you save your excel file as CSV, the new field separators will be used.
I just bought a Nokia E72, and like most of the people, when I came to know that the firmware has updates, I tried updating the phone software. As given in the manual, I tried installing Nokia PC suite which asked me to install Nokia Software updater in order to update the phone software from PC.
But when I tried connecting my device with my PC, though it connected in USB mode, but it kept asking to connect the device in PC Suite mode, while my Nokia phone was in PC Suite mode only. I tried connecting disconnecting multiple times, but with the same result. I am using Windows Vista Home Premium 64bit operating system. I do not know if that is causing an issue with the Nokia PC suite. I tried Googling but there was not much help available.
Then I accidentally landed on the, Nokia.co.in support page to check for software updates for my PC software. I thought if there were some issue with the software then they (Nokia guys) might have fixed it in new releases. But I found that I already have the latest software.
Then I found a short tip mentioned there which described the process of updating the phone software from the phone itself, while the actual software updater asks to use PC updater to update the phone software. It is very simple as given below:
- Key *#0000# into your phone’s home screen.
- Select Options > Check for updates.
- Follow the on-screen prompts until your update is complete!
And that is it. I tried it and it worked. My PC still does not recognize the PC suite mode of the device, but now I do not have any urgent need to do that. They might fix it in near future, but untill then I can update my phone software without it
.
When using special characters in UTF-8 character encoding, sometimes when you read something from mysql database then it is not displayed properly on the web page. Many of you like me may try to change the character encoding of the HTML page to ISO-8859-1, that may work sometimes but this is not the proper solution to the problem.
Irrespective of the character encoding used by MySql to store the text data, when you query something using SQL it returns the data encoded in the latin charset. This is defined in the mysql config files, as described below:
The character_set_results system variable indicates the character set in which the server returns query results to the client. This includes result data such as column values, and result metadata such as column names.
To change the character encoding to UTF8 or other, you need to use “mysql_set_charset()” mysql function in PHP. Pass the correct encoding name required and now future mysql queries will return result using new encoding.
I just faced this error message and the easy fix was to run following command:
Start >> Run
outlook.exe /resetnavpane
Voila it started working!
Search the site
Random Testimonial
- ~ Elance ID – ingariza
"This is the first time I used Elance, and I was blessed having Nirvaat as my provider, very professional, pro-active, great communication , on-time delivery, solve every problem I had. I recommend Nirvaat if you want your job on time, with quality and great support. Thanks" - Read more testimonials »
What's the little bird saying?
- @pavanagrawal If computers will start asking questions then who will answer it!!!!! we have to creat a human version of google! in reply to pavanagrawal 1 week ago
- Turn a USB Flash Drive Into Extra Virtual RAM [USB Drive] http://bit.ly/cb9fOT 2010-06-28
- Is Entrepreneurship Just About the Exit? http://bit.ly/99oan9 2010-06-12
- More updates...
Posting tweet...

July 25, 2010 in