Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Linux Ask!

Feb 102011
 

Setting the MySQL's Binary Log Format

Answer:

For MySQL 5.1.11 and earlier, and for MySQL 5.1.29 and later, statement-based logging is used by default as the binary log format. If you want to change it, e.g. to use the "row-based" format, do the following:

1. Edit the MySQL configurations, e.g. /etc/my.cnf

..
binlog_format=row
..

Don't forget to restart MySQL to take effect.

# /sbin/service mysqld restart

Reference: http://dev.mysql.com/doc/refman/5.1/en/binary-log-setting.html

Feb 082011
 

Turn on register_globals in PHP

Answer:

When turned on, register_globals will automatically inject the PHP script with variables such as those from HTML form. The feature was DEPRECATED and turn off by default in the recent PHP distributions.

But if you still want to change it, you need to edit the php.ini

vi /etc/php.ini

Locate and set

register_globals = on;

Remember to restart web server such as Apache if needed.

Feb 062011
 

Change the PHP’s maximum allowed form post size

Answer:

The default maximum allowed form post size in PHP is only 8MB. If you want to change it, you need to edit the php.ini

vi /etc/php.ini

Locate and set (16M in the following example)

memory_limit = 16M;
post_max_size = 16M;

Try it with the number you need.

Also, remember to restart web server such as Apache if needed.

Feb 042011
 

Unsafe SQL for MySQL's statement based replication

Answer:

Following are the list of MySQL's function which are unsafe if you are using statement based replication (which is the default in MySQL 5)

In short, if you are using MySQL's replication, do not use the following functions.

  • LOAD_FILE()
  • UUID(), UUID_SHORT()
  • USER()
  • FOUND_ROWS()
  • SYSDATE()
  • GET_LOCK()
  • IS_FREE_LOCK()
  • IS_USED_LOCK()
  • MASTER_POS_WAIT()
  • RELEASE_LOCK()
  • SLEEP()
  • VERSION()

Reference: http://dev.mysql.com/doc/refman/5.1/en/replication-sbr-rbr.html