| Journal Home Official Blog |
Restore MySQL database from sql dump file?Tweet This is more of a personal note for myself because I keep forgetting the syntax :p. When developing web applications I often, 'mess around' with the database and I then need to restore it to make sure everything is running ok, (or simply to run some kind of test again and again). z:\mysql.exe - u USERNAME -p DATABASE < dump.sql Enter password: ******** Replace USERNAME with your database username, DATABASE with your database name and of course the 'dumpo.sql' with the name of your sql dump file. You will then be asked to enter your password and the update should happen with not too much problems. if you get an error message like "'mysql.exe' is not recignized as ab internal or external command, ...." this is because mysql is not in your pa;th%, so you will need to run the command above with the full path where mysql.exe is located, (normally in your program files directory). 06h37 - 5/31/2011 - comments {0} - post comment
Share and enjoy
register_shutdown_function(...) doesn't work with ob_gzhandler(...)Tweet [I have decided to start adding some entries about the re-factoring of journal home, either it will help someone else or someone will be able to offer some comments] I am busy doing a lot of changes to the code of Journalhome.com to ensure that it runs better than the current software, (that is no longer supported in any case). My aim is to speed up the whole delivery of the page to the browsers. The problem with that is that some code that I want to be executed at the very end of the script, (as the script is completing) it does not seem to be executed. In php when you call ob_start('ob_gzhandler'); it tells the php compiler to take all the output, (everything going to the screen), and, instead of sending it to the screen we will send the string to a function called ob_gzhandler who in turn will return a compressed string. Normally the way it works is:
With ob_start( ... ) it is a litte bit more complex
What this means is that the created page is sent out as one big string to the browser.
The problem with that is the function ob_gzhandler(...) does not seem to allow the "Do do some completion code" The problem is almost certainly with register_shutdown_function(...), because as the manual clearly says, if any of the registered function call exit() then the processing will stop completely and no other registered function will be called. The other bigger problem with that logic, (and kind of backs up my theory), is that it seems to allow _some_of the registered code to be completed. This makes sense as the shutdown functions are called in the order they are registered so the ones registered before ob_start('ob_gzhandler'); will be executed but not the ones after. For example...
This works as expected with PHP 5.x and later, but not with php 4.x, (well not with php 4.4.x that I am using).
This will also not work with all flavours of php4.x but it will work with php5.x As I am planning to move to php 5 this is not a problem but I am trying very hard to make sure that he new code works on both 4.x and 5.x, (simply because I want the code to be open source. The 'fix' I have is to remove the compression altogether with php < 5.x
Obviously this is not a perfect solution as the code is no longer compressed, but for those that will be using php4, (that is no longer supported btw), then it will have to do. 07h22 - 8/6/2008 - comments {3} - post comment
Share and enjoy
|
Description
JournalHome.com has created this blog for the purpose of keeping members and visitors up to date with JournalHome.com site information.
Home User Profile Archives Friends My Wall Links Webmaster Forum Free Blog
Recent Entries - Happy new year! - Stand up against the Internet blacklist legislation - Very high server load - Started facebook promotion - Part 2 - Started facebook promotion Entry Categories - Contest - HTML Code - News - Web Security - Politics - PHP Code - Changelog |
||||||||||||||||||||||||||||||||||||||||||