viralpatel.info
News: www.viralpatel.info >> blog <new> !
Blog


Twitt this! Email this!
Dynamically added contents in hidden "iframe" was surrounded by <pre> tags in Chrome & Firefox.
innerHTML
: fetched added contents with "<pre>" tags

innerText
: fetched the original string ( in Chrome )
: fetched blank string ( in Firefox)

textContent
: fetched the original string ( in Chrome & Firefox)


source : How to remove HTML Tags from a string in Javascript








Twitt this! Email this!
Are you stuck with this error of mysql ?


Mysql #1130 - Host 'localhost' is not allowed to connect to this MySQL server




Cause : trying to set password of mysql.user manually.


mysql>update user set Password='newpwd' where user='root'





Reason:
mysql.user table stores Password in encrypted format.

So, if one attempts to set the Password manually using UPDATE statement, it updates the record as plain text password instead of encrypted password.

When user connects, the server reads the Password value from the user table and decrypts it to match creditials that were sent from the client.




Solution::
Step 1 : Stop the mysql service if it's already running
Step 2 : Create a text file 'mysql-init.txt' with following contents.


UPDATE mysql.user SET Password=PASSWORD('newpwd') WHERE User='root';
FLUSH PRIVILEGES;



  • UPDATE statement updates the mysql.user table with encrypted Password for user 'root'

  • FLUSH statement tells the server to reload the grant tables into memory.


Step 3 : Go to command promt (cmd)


C:\> C:\mysql\bin\mysqld-nt --init-file=C:\mysql-init.txt


The server executes the contents of the file named by the --init-file option at startup, changing each root account password.



reference : dev.mysql.com









21-Sep-2008

PHP Links


Twitt this! Email this!

PHP Links


List of interesting sites in PHP

Note: The list is in random order (will be updated as and when I came to know about new ones).

Feel free to add few as comments.

Open social
http://code.google.com/apis/opensocial/
OpenSocial is a common API for social applications.
Developers can create applications for different websites using HTML, Javascript.