Some MySQL tricks that could help you with your blog!

Do it manually is the lesson we are going to attend today.
And because not everybody loves plug-ins or scripts to do what he will do, this post is to show you how to make some tricks directly from the source.

hand_MySQL

I) NOFOLLOW

If you want to transform your links to NoFollow do this :

update wp_posts set `post_content` = replace(post_content, ‘<a href=’, ‘<a rel=”nofollow” href=’)

II) SELL INCONTENT LINKS

You can also use it to sell in content links.
A- Find the relevant anchor text

Select post_name, post_title, guid, from wp_posts where post_content like ‘%Your link  text%’;

This will give you the all the post that has this keyword.

B- Add hyperlink

update wp_posts set `post_content` = replace(post_content, ‘Your link  text’, ‘<a rel=”nofollow” href=”https://blogprocess.com” >Your link  text</a>’)

III) BACKUP and RESTORE

Having a large MySQL database make it very hard and sometimes impossible to backup and restore using the conventional phpmyadmin or any other program.But moving your website should not stop at this point.

First you need to have shell (ssh) access to your server.And you can use any free program like Xshell, Tunnelier or PuTTY to connect your server Then follow the steps:

[dbuname] : is your database username.
[passW] : is the password for your database (note there is no space between -p and the password).
[dbname] : is the name of your database.
[backup.sql] : is the file name for your database backup.

A- To Backup Mysql Database

$ mysqldump -u [dbuname] -p[passW] [dbname] > [backup.sql]

B- To Backup Mysql Database with compress

If your mysql database is very big, you might want to compress the output. Just use the mysql backup command below and choose the output to gzip, then you will get it as gzip file.

$ mysqldump -u [dbuname] -p[passW] [dbname] | gzip -9 > [backup.sql.gz]

C- To Restore Mysql Database
To restore the database you need to create the database in target machine then use this command

$ mysql -u [dbuname] -p[passW] [db.to.restore] < [backup.sql]

D- To Restore Compressed Mysql Database

gunzip < [backup.sql.gz] | mysql -u [dbuname] -p[passW] [dbname]

You May Also Like

Managing a PRINCE2 Project in Business

Managing a project as a top-level business goal requires a deep understanding of the company’s overall business objectives, strengths, and weaknesses.  Thus, to manage a project effectively, a project manager needs to understand project objectives and have knowledge of financial responsibilities, such as cash flow and profit targets. as on a PRINCE2 training Courses. When […]

5 Reasons You Need To Hire A Top-Rated Web Development Company For Your Next Web Business Project

Without a doubt, technology is influencing our future. It has already established itself in various areas, making life simpler and more enjoyable in certain respects. Nowadays, along with proper functioning and competent web creation, you need an organized digital marketing strategy that clears the path to success.  It takes a lot of time, effort, and […]

9 Tips For Designing Your Business Logo

Whether you are just starting a business and need a brand new logo or if you are in the process of a redesign and just need a refreshed logo, it’s important to put thought and effort into your business’ logo. Logos help with brand recognition and can help customers identify your company over any competitors […]

Ways to Optimize your blog for Mobile Searching

Would you believe this? The number of people accessing the web through their mobile phones has doubled from last year and at present; 22 million people search the net for various reasons everyday. WOW! That is an awesome number and it promises to grow exponentially with each passing day with most of the mobiles today […]