Chaning MySQL root password without access

14 May 2010 In: MySQL
  1. Stop the mysqld daemon process.
  2. Start the mysqld daemon process with the–skip-grant-tables option.
  3. Start the mysql client with the -u rootoption.
  4. Execute the UPDATE mysql.user SET Password=PASSWORD(‘password’) WHERE User=’root’;
  5. Execute the FLUSH PRIVILEGES;command.

These steps reset the password for the “root” account to “password”. To change the password for a different account, or to set a different password, just edit the variables in single-quotes in step 4.

If you know your existing MySQL root password, steps 1-3 are not necessary.

  • Comments Off

Part 1 of this article looked at the fulltext index, and how to search on it using an ordinary MATCH() AGAINST(). Even more powerful, (although only available on the newer MySQL version 4), is the ability to do a boolean search. Part 2 of this article examines the possibilities.

You’ll use the same table you used in Part 1. The full list of records is:

mysql> SELECT * FROM fulltext_sample;
+---------------------------+
| copy                      |
+---------------------------+
| It appears good from here |
| The here and the past     |
| Why are we here           |
| An all-out alert          |
| All you need is love      |
| A good alert              |
+---------------------------+

To perform a boolean search, the IN BOOLEAN MODE modifier is used. The following query demonstrates the new syntax.

Read the rest of this entry »

Using Fulltext Indexes in MySQL – Part 1

26 Mar 2010 In: MySQL

One of the more useful MySQL features is the ability to search for text using a FULLTEXT index. Currently this is only available if you use the MyISAM table type (which is the default table type, so if you don’t know what table type you’re using, it’ll most likely be MyISAM). A fulltext index can be created for a TEXT, CHAR or VARCHAR type field, or combination of fields. We’re going to create a sample table and use it to explore the various features.

The simple form of usage (the MATCH() function) is available to all MySQL servers from version 3.23.23, while the more complex usage (the IN BOOLEAN MODE modifier) is available from version 4. The first part of this article looks at the former, and the second part at the latter.

A sample table

We’re going to use the following table throughout this tutorial.

CREATE TABLE fulltext_sample(copy TEXT,FULLTEXT(copy)) TYPE=MyISAM;
The TYPE=MyISAM clause isn’t necessary unless you’ve set the default table type to be something other than MyISAM (perhaps you use InnoDB tables to make use of MySQL’s transactional capabilities). Once you’ve created the table, populate it with some data, as follows:
INSERT INTO fulltext_sample VALUES
(‘It appears good from here’),
(‘The here and the past’),
(‘Why are we hear’),
(‘An all-out alert’),
(‘All you need is love’),
(‘A good alert’);
If you’d already created an existing table, you can add a FULLTEXT index with the ALTER TABLE statement (as well as the CREATE INDEX statement), for example:
Read the rest of this entry »

  • Comments Off

Sometime it is necessary to find out what file(s) or directories is eating up all disk space. Further it may be necessary to find out it at particular location such as /tmp or /var or /home etc.

There is no simple command available to find out the largest files/directories on a Linux/UNIX/BSD filesystem. However, combination of following three commands (using pipes) you can easily find out list of largest files:

du : Estimate file space usage
sort : Sort lines of text files or given input data
head : Output the first part of files i.e. to display first 10 largest file
Here is what you need to type at shell prompt to find out top 10 largest file/directories is taking up the most space in a /var directory/file system:
# du -a /var | sort -n -r | head -n 10

Output:

1008372 /var
313236 /var/www
253964 /var/log
192544 /var/lib
152628 /var/spool
152508 /var/spool/squid
136524 /var/spool/squid/00
95736 /var/log/mrtg.log
74688 /var/log/squid
62544 /var/cache
If you want more human readable output try:

# du -ks /var | sort -n -r | head -n 10

Where,

-a : Include all files, not just directories (du command)
-h : Human readable format
-n : Numeric sort (sort command)
-r : Reverse the result of comparisons (sort command)
-n 10 : Display 10 largest file. If you want 20 largest file replace 10 with 20. (head command)

  • Comments Off

Scott Jehl has released jQuery Visualize, the plugin that groks HTML tables and generates lovely charts from it, all from a simple $(‘table’).visualize(); (lot’s of options for you to twiddle too if you want).

First, you create a bog standard table like:

<table border="0">
<caption>2009 Individual Sales by Category</caption>
<thead>
<tr>
<td></td>
<th>food</th>
<th>auto</th>
<th>household</th>
<th>furniture</th>
<th>kitchen</th>
<th>bath</th>
</tr>
</thead>
<tbody>
<tr>
<th>Mary</th>
<td>150</td>
<td>160</td>
<td>40</td>
<td>120</td>
<td>30</td>
<td>70</td>
</tr>
<tr>
<th>Tom</th>
<td>3</td>
<td>40</td>
<td>30</td>
<td>45</td>
<td>35</td>
<td>49</td>
</tr>
...repetitive rows removed for brevity.</tbody></table>

Then you visualize it. You end up with pretty graphs like these:
jquery visualize

Text rotation with CSS

21 Aug 2009 In: Bookmarks, CSS

Jonathan Snook posted good CSS stuff on Text Rotation with CSS that takes a nice bit of markup like this:

<div class="example-date">
  <span class="day">31</span> 
  <span class="month">July</span> 
  <span class="year">2009</span>
</div>

and converts it to:
text-rotation
all via the CSS:

-webkit-transform: rotate(-90deg); 
-moz-transform: rotate(-90deg);	
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);

yeah as you can see it’s working on IE too. Not bad ha?

Fuck This Website!

27 Jul 2009 In: Bookmarks

I found this website about 2 or years ago. it’s freaking funny xD Here are some picture from the site;
Tiger Terror Read the rest of this entry »

CSS 3 and HTML 5 Cheat Sheet (PDF)

27 Jul 2009 In: Bookmarks, CSS

I saw this and this post on smashin magazine.
You can download this sheets for free
CSS 3
CSS 3 Sheet

HTML 5
HTML 5 Sheet

PHP 5.3 Released!! Horeyyy!!

27 Jul 2009 In: PHP

I can’t blog much cuz of my works. I’m pretty busy in these days. When i check php.net, i saw PHP 5.3 released post in 30 Jun -.- nevermind. After a long string of delays, PHP 5.3 is finally out. On the course of last 2 years, I was pretty sure a number of times that it will happen next month the latest, but there always were good reasons to postpone it. Now finally it’s officially out. I think it’s a huge step for PHP. Download it and try it!

Some major new features in 5.3:
Read the rest of this entry »

How to change SSH welcome message on linux

8 Jul 2009 In: Linux

Every time I connect to my home server through my ssh client, I receive the same message and I’m getting bored of seeing it, so I decided to change the message to something else.

Here’s the message that I get every time:
Read the rest of this entry »


Sponsors

1. http://abell.as.arizona.edu/~hill/cgi-bin/webglimpse.cgi/home/hill/public_html/4x4?query=%22%3E%3Ca+href%3Dhttp%3A%2F%2Fwww.rollondoc.com%3ELink%3C%2Fa%3E&errors=0&age=&maxfiles=50&maxlines=30&cache=yes 2. http://aboutdomain.org/info/www.rollondoc.com/ 3. http://aboutus.org/www.rollondoc.com 4. http://alexa.com/siteinfo/www.rollondoc.com 5. http://backlinkcheck.com/popular.pl?url1=www.rollondoc.com&cache=yes 6. http://backtype.com/url/www.rollondoc.com&cache=yes 7. http://browsershots.org/http://www.rollondoc.com 8. http://builtwith.com/?www.rollondoc.com 9. http://checkdomain.com/cgi-bin/checkdomain.pl?domain=www.rollondoc.com&cache=yes 10. http://childstats.gov/disclaim.asp?URL=http://www.www.rollondoc.com&cache=yes 11. http://ciac.llnl.gov/cgi-bin/webglimpse/www/htdocs/ciac/archive?query=%22%3E%3Ca+href%3Dhttp%3A%2F%2Fwww.rollondoc.com%3ELinks%3C%2Fa%3E&errors=0&age=&maxfiles=50&maxlines=30&cache=yes 12. http://cnm.edu/extlink.php?link=http://www.rollondoc.com 13. http://cqcounter.com/rbl_check/?query=www.rollondoc.com&cache=yes 14. http://cqcounter.com/siteinfo/?query=www.rollondoc.com&cache=yes 15. http://cqcounter.com/traceroute/?query=www.rollondoc.com&cache=yes 16. http://cubestat.com/www.rollondoc.com&cache=yes 17. http://democrats.assembly.ca.gov/members/scripts/redirect.asp?url=http://www.rollondoc.com&cache=yes 18. http://domains.whois.com/domain.php?action=whois&query=www.rollondoc.com 19. http://esitestats.com/www.rollondoc.com&cache=yes 20. http://export.gov/wcm/fragments/fl_eg_outsidelinks/redirect.asp?URL=http://www.rollondoc.com&cache=yes 21. http://www.fairfaxcounty.gov/offsite/?pg=http://www.rollondoc.com 22. http://www.fbi.gov/cgi-bin/outside.cgi?http://www.rollondoc.com 23. http://www.fcc.gov/fcc-bin/bye?http://www.rollondoc.com 24. http://feedest.com/feedHost.cfm/host/www.rollondoc.com&cache=yes 25. http://find-ip-address.org/whois/mrwhois_details.php?ddomain=www.rollondoc.com&server=whois.opensrs.net 26. http://www.fmc.gov/home/offsite.asp?URL=http://www.rollondoc.com&cache=yes 27. http://grader.com/site.php?URL=www.rollondoc.com&cache=yes 28. http://home.nps.gov/applications/redirect/?sUrl=http://www.rollondoc.com 29. http://hosts-file.net/?s=www.rollondoc.com&cache=yes 30. http://ip-adress.com/whois/www.rollondoc.com&cache=yes 31. http://iwebtool.com/pagerank_checker?domain=www.rollondoc.com 32. http://marad.dot.gov/exit.asp?type=1&url=www.rollondoc.com&cache=yes 33. http://markosweb.com/www/www.rollondoc.com/ 34. http://milonic.com/whois.php?domain=www.rollondoc.com&ref=&WebServer= 35. http://www.minfin.gov.by/search/?action=index&text=%22%22%3E%3Ca+href%3Dhttp%3A%2F%2Fwww.rollondoc.com%2F%3ELink%3C%2Fa%3E%3C%22 36. http://namedroppers.com/who/www.rollondoc.com 37. http://ncsacw.samhsa.gov/offsite.asp?url=http://www.rollondoc.com&cache=yes 38. http://netvaluer.com/show.asp?site=www.rollondoc.com&cache=yes 39. http://networksolutions.com/whois-search/www.rollondoc.com&cache=yes 40. http://network-tools.com/default.asp?prog=whois&host=www.rollondoc.com&cache=yes 41. http://nws.noaa.gov/cgi-bin/nwsexit.pl?url=http://www.rollondoc.com&cache=yes 42. http://nsf.gov/cgi-bin/good-bye?http://www.rollondoc.com 43. http://nps.gov/cgi-bin/intercept?http://www.rollondoc.com 44. http://opic.gov/leaving.asp?url=http://www.rollondoc.com&cache=yes 45. http://oceanservice.noaa.gov/cgi-bin/redirout.cgi?url=http://www.rollondoc.com&cache=yes 46. http://page2rss.com/page?url=www.rollondoc.com/ 47. http://pageheat.com/heat/www.rollondoc.com 48. http://protect-x.com/info/www.rollondoc.com&cache=yes 49. http://quantcast.com/www.rollondoc.com 50. http://quantcast.com/profile/no-data-for-site?domain=www.rollondoc.com&cache=yes 51. http://quarkbase.com/show/www.rollondoc.com 52. http://quest.nasa.gov/cgi-bin/glimpse2/webglimpse.cgi?ID=1&cache=yes&query=%22%3E%3Ca+href%3Dhttp%3A%2F%2Fwww.rollondoc.com%3Links%3C%2Fa%3E&errors=0&age=&maxfiles=50&maxlines=30&cache=yes 53. http://ratite.com//whois/whois.cgi?domain=www.rollondoc.com&cache=yes 54. http://registrar.verisign-grs.com/cgi-bin/whois?whois_nic=www.rollondoc.com&x=60&y=12&type=domain&cache=yes 55. http://rehab.alabama.gov/Home/Misc/Redirect.aspx?url=http://www.rollondoc.com&cache=yes 56. http://ram3.chem.sunysb.edu/cgi-bin/webglimpse.cgi?ID=2&query=%22%3E%3Ca+href%3Dhttp%3A%2F%2Fwww.rollondoc.com%3ELinks%3C%2Fa%3E&rankby=DEFAULT&errors=0&age=&maxfiles=20&maxlines=10&maxchars=2000&cache=yes 57. http://reports.internic.net/cgi/whois?whois_nic=www.rollondoc.com&type=domain&cache=yes 58. http://robotics.nasa.gov/rcc/redirect.php?url=%2F%2Fwww.rollondoc.com&cache=yes 59. http://roc.noaa.gov/scripts/exit/osfexit.pl?url=http://www.rollondoc.com&cache=yes 60. http://robtex.com/dns/www.rollondoc.com.html 61. http://seoarena.org/sh/www.rollondoc.com/ 62. http://siteadvisor.cn/sites/www.rollondoc.com/summary/&cache=yes 63. http://siteadvisor.cn/sites/www.rollondoc.com 64. http://siteanalytics.compete.com/www.rollondoc.com 65. http://sitedossier.com/site/www.rollondoc.com&cache=yes 66. http://sitetiki.com/www.rollondoc.com&cache=yes 67. http://snapnames.com/?aff=321&dom=www.rollondoc.com&cache=yes 68. http://spacereg.com/a.rpl?m=whois&domain=www.rollondoc.com&cache=yes 69. http://statbrain.com/www.rollondoc.com&cache=yes 70. http://statsaholic.com/www.rollondoc.com&cache=yes 71. http://tampafl.gov/common/redirect.asp?redirect=www.rollondoc.com/&cache=yes 72. http://tgsc.ru/redirect/http://www.rollondoc.com&cache=yes 73. http://toolbar.netcraft.com/site_report?url=http://www.rollondoc.com&cache=yes 74. http://www.transtats.bts.gov/exit.asp?url=http://www.rollondoc.com&cache=yes 75. http://tweetmeme.com/domain/www.rollondoc.com 76. http://uk1.co.uk/cgi-bin/cart/cart.cgi?typeofsearch=rawwhois&domain=www.rollondoc.com&server=whois.nic.uk&cache=yes 77. http://uptime.netcraft.com/up/graph?site=www.rollondoc.com&cache=yes 78. http://urladex.com/index.py?page=url&url=www.rollondoc.com&cache=yes 79. http://urltrends.com/viewtrend.php?url=www.rollondoc.com&cache=yes 80. http://websiteaccountant.com/www.rollondoc.com&cache=yes 81. http://websiteoutlook.com/www.www.rollondoc.com&cache=yes 82. http://whois.webhosting.info/www.rollondoc.com 83. http://www.weather.gov/cgi-bin/nwsexit.pl?url=http://www.rollondoc.com&cache=yes 84. http://whatismyip.com.np/whois.php?query=www.rollondoc.com&cache=yes 85. https://who.securepaynet.net/whoischeck.aspx?ci=14582&domain=www.rollondoc.com&prog_id=enet_world&cache=yes 86. http://who.godaddy.com/whoischeck.aspx?Domain=www.rollondoc.com&cache=yes 87. http://who.is/whois/www.rollondoc.com/&cache=yes 88. http://whois.domainpeople.com/whois.cgi?domain=www.rollondoc.com&cache=yes 89. http://whois.domaintools.com/www.rollondoc.com&cache=yes 90. http://whois.net/whois/www.rollondoc.com&cache=yes 91. http://whois.tools4noobs.com/info/www.rollondoc.com&cache=yes 92. http://whoisbeta.com/index.php?query=www.rollondoc.com&cache=yes 93. http://whoisbucket.com/view/www.rollondoc.com&cache=yes 94. http://whoisd.com/search.php?code=2119&domain=www.rollondoc.com&GO=GO 95. http://whoisn.com/lookup.php?domain=www.rollondoc.com&button1=Check&cache=yes 96. http://whois-search.com/whois/www.rollondoc.com&cache=yes 97. http://whoisx.co.uk/www.rollondoc.com&cache=yes 98. http://whoisya.com/www.rollondoc.com&cache=yes 99. http://workforcesecurity.doleta.gov/foreign/redirect.asp?link=www.rollondoc.com/&cache=yes 100. http://www2.scc.rutgers.edu/ead/showfile.php?filename=http://www.rollondoc.com&cache=yes 101. http://www3.mt.gov.br/redirect.php?url=//www.rollondoc.com/&cache=yes 102. http://www-nrd.nhtsa.dot.gov/utility/direct.asp?url=http://www.rollondoc.com&cache=yes 103. http://xmarks.com/site/www.rollondoc.com/&cache=yes 104. http://zoneedit.com/whois.html?zone=www.rollondoc.com&cache=yes