Mysql

php5.3 and mysqlnd old authentication issue

After upgrading to php5.3, i got this problem: [sourcecode] SQLSTATE[HY000] [2000] mysqlnd cannot connect to MySQL 4.1+ using old authentication [/sourcecode] Here is what i found: * php 5.3 now use a native extension to use mysql : mysqlnd * my database credential was old (4 years old maybe) and still use the old mysql authentication * mysqlnd needs the new 41bytes password The problem was easy to solve: First, open '/etc/my.cnf' in Linux or 'my.ini' in Windows, ...

How to Find and Replace Text in MySQL Database using SQL

MySQL database has a handy and simple string function REPLACE() that allows table data with the matching string (from_string) to be replaced by new string (to_string). This is useful if there is need to search and replace a text string which affects many records or rows, such as change of company name, postcode, URL or spelling mistake. The syntax of REPLACE is REPLACE(text_string, from_string, to_string) MySQL reference describes REPLACE as function that returns the string text_string wit...

Using mysql to replace word in database

Table:mt-entry subject: entry_text search:abc replace:def [sourcecode language="plain"]update mt_entry set entry_text=replace(entry_text,'abc','def')[/sourcecode]