Monthly Archives: May 2010

Search and Replace Text String in MySQL Database with phpMyAdmin

Sometime you might facing problem to replace the string or data in mysql and you have many row inside your table.  Here is the solution you can put in to SQL command line in phpmyadmin, this solution is work for mysql too.  Before begin please back all your sql 1st, in case you make any mistake.

Open phpmyadmin -> click on database -> click on table name -> click on SQL tab on top then enter the command below:

UPDATE tablename SET field = replace(field, "SearchString", "ReplaceString");

please change:
tablename
field
SearchString
ReplaceString

according your table name and field.
you can also add where Clause ( add condition for this sql statemen )

UPDATE tablename SET field = replace(field, "SearchString", "ReplaceString") WHERE field2='SomeValue';

Hope this help..

Disable open_basedir in Plesk

Disable open_basedir in Plesk

This explanation tells you how to disable open_basedir in plesk without breaking/commenting your current httpd.conf basedir lines.

Create a new file, called vhost.conf
This file will include anything you want to disable from httpd.conf main config from your virtual host.

touch /var/www/vhosts/yourdomain.com/conf/vhost.conf

Now we edit the file and we add the following,

/var/www/vhosts/yourdomain.com/conf/vhost.conf
php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir none

Once you finish adding the mentioned lines, its time to reconfigure and restart the webserver config.

/usr/local/psa/admin/sbin/websrvmng -v -a

You should be done by now.