You can have your "contacts" table in "my_db" with following syntax: Read the rest of this entry »
Archive for category Database
You can have your "contacts" table in "my_db" with following syntax: Read the rest of this entry »
HeidiSQL has been excellent SQL Administration and Development tool so far for me. HeidiSQL has active development team which keeps adding new feature and upgrading and correcting bugs to get us the great tool for MySQL development.
I have been using HeidiSQL since more than three and half years now and I am really happy with it. I must say that we work with heavy database consisting of more than 400 tables and database size exceeding few GBs but HeidiSQL has never let us down. I have tried loading my development database with phpMyAdmin and SQL Buddy both but they just failed to load such a large database with few hundreds of tables..! But with HeidiSQL I never had any problem except I got some crashing sometime in newer 5.x version but I am sure all such things will be fixed in coming builds. I am not telling that there are no other good tools are available in the market but HeidiSQL is in premium open-source tool at free of cost. I remember I had written a post on HeidiSQL 4.x more than a year ago and today we are up with HeidiSQL 5.1. Read the rest of this entry »
Loading data from and to CSV or other TAB DELIMITED or similar file format is essential in day to day operation. With MySQL it is easy to load data into table using files and exporting data into CSV files is quite easy. No need to use any external tool it can be done right there from the query tool/command prompt, no specific GUI tool required.
Let's see how?
Exporting data as CSV file directly using simple MySQL Query
Simply add INTO OUTFILE [FILE_PATH] in your query and you are done. Here is a simple example:
SELECT * FROM [TABLE] INTO OUTFILE 'X:/[FILE]'
Above statement uses default options for file export of result set of a query, but it is simple to override them. By default file will be TAB DELIMITED file. We can always override as showed in example below:
SELECT * FROM [TABLE] INTO OUTFILE 'X:/[FILE]' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n'
OR
SELECT * INTO OUTFILE 'X:/[FILE]' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' FROM [TABLE]
The beauty is it don't really matter where you place FROM TABLE clause, any of the style would work from above example. Don't forget that we can use all our complex join or where conditions which we really use with SELECT. Read the rest of this entry »
Whether you are using MySQL with MyISAM or InnoDB or other database engine it is possible to backup/restore database using MYSQLDUMP utility. Though if you have all tables in MyISAM format MYSQLHOTCOPY is faster option but in any case MYSQLDUMP is a handly tool if you have got a mix set of tables.
Commands are very quick simple and easy to execute and can be made automated by a PHP or other script/tool.
How to backup using mysqldump?:
Before you use any of commands you have to move to mysql/bin directory of your MySQL installation and MySQL server should be up and running.
To backup all MySQL database on a server:
mysqldump --user=[USER] --password=[PASSWORD] -A > C:/BACKUP_PATH/BACKUP_TIMESTAMP.SQL
To backup specific MySQL database on a server:
mysqldump --user=[USER] --password=[PASSWORD] [DATABASE] > C:/BACKUP_PATH/BACKUP_TIMESTAMP.SQL
To backup certain tables in a MySQL database: Read the rest of this entry »
This post represents thoughts based upon my experience and I have not reported this issue to Sybase as of yet, I firmly believes that such result should not return in given case and so I am representing my thoughts with example over my blog here.
Topic: "Sybase SQL Anywhere Database is buggy when we sort results by column which is having granularity close to Zero".
As I am developing PHP Web Applications, some time back I have faced an issue while I was using a control panel of the web application. It was using Sybase SQL Anywhere as the database engine. The problem was wired, I was not able to search a particular menu item which I have to make active/inactive through the list of about 20 or so odd rows. I was switching through pages and the results were sorted by "status" column, which was having value of either "active" or "inactive". I searched by keyword and I got the result immediately in my data-grid..! It was surprising and unexpected. At first what came into my mind was that oh..! there must be something wrong with my application framework or DAL (Data Access Layer).
Then I took the same query and I fired in the SQL Anywhere - Interactive SQL. The results were unexpected, I felt like this is a "bug" with Sybase itself. To avoid any doubt I created new table with some records and repeated the test and results were same. This incident has taken place at my workplace.
After some time I downloaded Sybase SQL Anywhere Web Edition 11.0 at my own desktop. I thought I was using bit older version at my office and here with the latest version the bug will be fixed, as this edition is using same engine which is used for their Enterprise products and there are some connection/licenses stuff which makes it Web Edition. I repeated the sequence and bingo the bug is still there.
Here is the details of the test as of last tested on Sybase SQL Anywhere Web Edition 11.0: Read the rest of this entry »
HeidiSQL 4.0 RC1 released
Jan 10
I am not sure how many MySQL developers are using HeidiSQL for development but I am sure those who are using it will be fan of some of it's features.!
I have been using HeidiSQL tool for my php/mySQL development for a while now. (more than a year and half..!). Before few months I have upgraded to newer version of HeidiSQL which is 4.1 RC1. It has got quite new and exciting features, looks and skins are improved. Read the rest of this entry »

MySQL 5.1 general availability is announced and it is available to be used for production use.
MySQL 5.1 brings many new enhancements in the bag for world's most popular open source database. which includes Partitioning, Row based Replication, new Plugin Infrastructure and there are many more including general enhancements.
There is a long list of new enhancements which you can go through in What's New section here.
Download it here if you are ready to put it in production or want to play with it in your development enviornment.

