Showing posts with label Wordpress. Show all posts
Showing posts with label Wordpress. Show all posts

Wednesday, June 11, 2014

Error establishing a database connection fix

To fix the below error, follow the steps below:


Go to the root directory of wordpress installation and execute the below script to generate the MySQL query.

root@server [/home/clearosa/public_html]# for i in `find -iname wp-config.php` ; do j=$(grep 'DB_NAME' $i | awk -F "'" '{print $4}') ; k=$(grep 'DB_USER' $i | awk -F "'" '{print $4}') ;l=$(grep 'DB_PASSWORD' $i | awk -F "'" '{print $4}') ; echo GRANT ALL PRIVILEGES ON $j.* TO $k@"localhost" identified by "'$l'"";" ; done

Sample Output:

root@meow [/home/kooi/public_html]# for i in `find -iname wp-config.php` ; do j=$(grep 'DB_NAME' $i | awk -F "'" '{print $4}') ; k=$(grep 'DB_USER' $i | awk -F "'" '{print $4}') ;l=$(grep 'DB_PASSWORD' $i | awk -F "'" '{print $4}') ; echo GRANT ALL PRIVILEGES ON $j.* TO $k@"localhost" identified by "'$l'"";" ; done
GRANT ALL PRIVILEGES ON kooid.* TO buhaha@localhost identified by 'koppan';

Now copy the MySQL query and execute it in MySQL prompt to fix this error.


Sunday, October 6, 2013

Backend commands to get Wordpress Details

Please select the appropriate database and enter the MySQL prompt. You can get the details of the database by checking the wp-config file.



select * from wp_options where `option_name` = 'siteurl';
select * from wp_options where `option_name` = 'home';
SELECT * FROM `wp_options` WHERE `option_name` = 'current_theme';
UPDATE `eugi12_wrdp1`.`wp_users` SET `user_pass` = MD5( '12345678' ) WHERE `wp_users`.`ID` =1;

Find the version of Wordpress : grep wp_version wp-includes/version.php

Monday, January 16, 2012

Installing Wordpress in Linux servers without control panels

Wordpress is a popular bloging tool and a famous CMS which uses mysql and php. Its most widely used because of its simplicity.

To instal wordpress in a linux server, follow the steps below:

1.Navigate to the Document root of the domain.
2. wget http://wordpress.org/latest.tar.gz
3. tar -xzvf wordpress-3.3.1.tar.gz
4. mv wordpress/* .
5. cp -p wp-config-sample.php wp-config.php
6. Open wp-config.php and give the DB info.
7. Open url : domainname/wp-login.php
8. Fill the details and click install wordpress.

Thats it. You have successfully installed wordpress :)

Sunday, December 18, 2011

Wordpress Hacked and Prevention

Hackers are hack for many reasons. Some of the common reasons why hackers hack are to get some Sensitive Information or to Steal Bandwidth to Distribute Illegal Content or may be for fun. Since there are many hackers around its our duty to keep our websites safe.

Since your site is wordpress, i will suggest some steps to prevent this in future:
1. Always update your wordpress to the latest version.
2. Configure a firewall on your server.
3. Always use complex passwords instead of simple ones.
4. Use an anti virus and update the virus database regularly.
5. Always take backup of your site on a weekly / monthly basis so that we cam restore it if anything happens.

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Affiliate Network Reviews