2011年2月

Resetting the root password of a MySQL database is trivial if you know the current password if you don't it is a little tricker. Thankfully it isn't too difficult to fix, and here we'll show one possible way of doing so.

If you've got access to the root account already, because you know the password, you can change it easily:

steve@steve:~$ mysql --user=root --pass mysql Enter password: mysql> update user set Password=PASSWORD('new-password-here') WHERE User='root'; Query OK, 2 rows affected (0.04 sec) Rows matched: 2 Changed: 2 Warnings: 0 mysql> flush privileges; Query OK, 0 rows affected (0.02 sec) mysql> exit Bye

However if you don't know the current password this approach will not work - you need to login to run any commands and without the password you'll not be able to login!

Thankfully there is a simple solution to this problem, we just need to start MySQL with a flag to tell it to ignore any username/password restrictions which might be in place. Once that is done you can successfully update the stored details.

First of all you will need to ensure that your database is stopped:

root@steve:~# /etc/init.d/mysqld stop

Now you should start up the database in the background, via the mysqld_safe command:

root@steve:~# /usr/bin/mysqld_safe --skip-grant-tables & [1] 6702 Starting mysqld daemon with databases from /var/lib/mysql mysqld_safe[6763]: started

Here you can see the new job (number "1") has started and the server is running with the process ID (PID) of 6702.

Now that the server is running with the --skip-grant-tables flag you can connect to it without a password and complete the job:

root@steve:~$ mysql --user=root mysql Enter password: mysql> update user set Password=PASSWORD('new-password-here') WHERE User='root'; Query OK, 2 rows affected (0.04 sec) Rows matched: 2 Changed: 2 Warnings: 0 mysql> flush privileges; Query OK, 0 rows affected (0.02 sec) mysql> exit Bye

Now that you've done that you just need to stop the server, so that you can go back to running a secure MySQL server with password restrictions in place. First of all bring the server you started into the foreground by typing "fg", then kill it by pressing "Ctrl+c" afterwards.

This will now allow you to start the server:

root@steve:~# /etc/init.d/mysqld start Starting MySQL database server: mysqld. Checking for corrupt, not cleanly closed and upgrade needing tables..

Now everything should be done and you should have regained access to your MySQL database(s); you should verify this by connecting with your new password:

root@steve:~# mysql --user=root --pass=new-password-here Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5 to server version: 5.0.24a-Debian_4-log Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> exit Bye

Original Post: http://desktopserver.com/how-a-smaller-web-host-increases-your-google-pagerank/

When deciding on a web hosting company bigger isn’t always better. Your sites importance to search engines can be over 30 percent higher if you go with a small, but reliable web host. I’ve seen  articles about this, but most got way too technical.

When you have links going to your site (called backlinks) search engines like Google usually give your site more importance. The problem is when you get links from a web site that shares the same class C block, and then you get no boost in search engine ranking from those sites. They see you’re hosted on the same ISP, and it’s too easy to game the system by putting 100 domains linking to each other that way.

All web sites have an IP address, which is just their location on the internet and a typical number would be  97.74.104.201 (which is for Godaddy.com). The red part is the class C section, and links from any other web sites with that same number will not count towards your Google ranking. With a place like Godaddy.com which has a 35% market share in the hosting business, that can be a LOT of sites you never get credit from even if they link to yours.

That’s why I recommend going with a smaller host with less than 5% market share, and using different ones for each domain you’re hosting (if you plan on linking them to each other). Of course the downside is if you have a lot of domains, having ten different hosting accounts can be a hassle. It’s really no more expensive, since many places charge in the $5 a month range.

Also one thing to consider is if you post on dofollow blogs (like this one) or are trying for a top commenter spot on a really popular site (to get the dofollow link that plugin provides), I’d check to see which host they are on to make sure it’s not the same as yours or the effort will be wasted. To check easily there’s a Class C checker herewhere you can enter in the URL’s without having to look each one up by hand.

Some of the ones I like that are dependable but don’t have the Godzilla market share that Godaddy has are:

FatCow Web Hosting The thing that’s unique is their servers are all powered by wind generated electricity and the $5 a year plan for placeholding a domain with email. They recently lowered their full hosting package down to $5.50 a month which is in line with all the others. This has been verified they don’t share netblocks with Godaddy.

JustHost They have $3.95 a month hosting and no limits on transfers or disk space for sites. They are on their own class C, again not shared with Godaddy. They also offer a transfer plan to make it easier to move an existing domain. While not as eco friendly as Fatcow, they do offer a more generous plan for less money.

In the next article, I’ll go over dofollow blogs and how to find them. Also the most popular commenter plugin which can really help build comments on a blog. I only comment on blogs that have one or the other or you get no link credit for the time you spent posting. Also for bloggers I’ll cover deep linking as well this week.  More on that next time.