Learning On Demand Learning anything from anywhere

Archive for the ‘Database’ Category

Get table diff with sqlyog

12.08.2007 · Posted in Database

As the job area getting bigger and bigger, new tables created and others table get normalize. It’s often to see adding field or remove some field from table. Development phase also take some place and different computer.  Need more time to get ‘whats new‘ in table structure. An illustration for example : Working to make ...

ERROR 2003: Can’t connect to MySQL server

07.31.2007 · Posted in Database

I Need to add remote user for add, select, update and delete in mysql. grant select,insert,update,delete on postfix.* to "postfix_rc"@"%" identified by "postfix_xxxxyyy" with grant option; try to access : -bash-2.05b$ mysql -upostfix_rc -p -h 172.88.1.5 Enter password: ERROR 2003: Can’t connect to MySQL server on ’172.88.1.5′ (61) according to this, that means no tcp/ip ...

Migrating from mysql 4.0 to mysql 5.0 in FreeBSD

07.26.2007 · Posted in Database, Unix

Final decision has been made, upgrade to mysql 5.0 is a must. But how to do that? How about user data? After doing it by myself I found it’s easy. I try to share my experience in sbs (step by step) form Situation : I have two server kongja and proxy : Server kongja has ...

Backup and Restore many mysql database in one shot

07.14.2007 · Posted in Database

Its my bad for not reading database manual that lead me for doing boring task . Dump a few database from server and dumping it in my windows xp. one by one. Perhaps someone who see this post can learn and not doing same mistake as me. Command to backup one database : backup database ...

Diff database structure with sqlyog

07.13.2007 · Posted in Database

When requirement for information stored in database grow, old table structure need to adjust for flexibility. Common task to do in  normal cycle : 1. Build new application in other place 2. Synchronize database ( tables) 3. Upload application. Second step ( synchronize tables) often  painful when a lot of changes made at home and ...

Some mysql sql basic command I must remember

06.02.2007 · Posted in Blog, Database

I use phpmyadmin in daily environment, do I still know  sql command? My sql file too large, it’s hard to import using phpmyadmin, please help me Some question around mysql from my student, my false make them spoil using phpmyadmin all day long Here’s my answers : 1. Command to create database create database databasename ...

Insert data when empty and update it when data exist

06.01.2007 · Posted in Database

With so many function provided in mysql plus lazy, It seem like finding gem for replace my old approach duplicate data isn’t good, I must search for exisiting data, in general : insert data to table when no data with that value exist and update table if data exist For example : I have table ...

Mysql 4.0 and Mysql 4.1 Compability

05.21.2007 · Posted in Database

My friend install serendipity (blog engine) in his laptop with mysql version 4.1.21 and dumping sql of his blog. When I try to restore sql file in his PC I got error message : Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\Administrator>cd c:\appserv\mysql\bin C:\AppServ\mysql\bin>mysql -uroot -p alam < blog.sql Enter ...

Insert time in mysql using now()

05.02.2007 · Posted in Database

Simple way to insert time information in mysql is using now() now() will automatically insert appropriate depends on type, let say we have field in mysql database in these format : 1. birth (date), now() will insert current date, ex: 2007-05-02 2. birth (datetime), now() will insert current date + current time, ex : 2007-05-2 ...

Top 10 SQL Performance Tips 5

11.25.2006 · Posted in Database

“Have good SQL query standards” Gee, seem easy to say but often difficult to deploy. Many people tend to use abstraction layer like adodb, pear, ezsql etc . They have coding convention and good manual. Portable SQL will lead on good application, seamless integration with other DB. How about You? ...