mysql basic commands

Basic commands login to mysql (from linux shell) mysql -u root -p mysql -h hostname -u root -p create database mysql> create database database_name; show all databases mysql> show databases; use a database. mysql> use database_name; To see all the tables in the db. mysql> show tables; delete a database mysql> drop database database_name; delete […]

Read More…

Delete un-used tags in WordPress

Open phpMyAdmin, make a backup of your database first Find all un-used tags SELECT * From wp_terms wt INNER JOIN wp_term_taxonomy wtt ON wt.term_id=wtt.term_id WHERE wtt.taxonomy=’post_tag’ AND wtt.count=0; Delete all un-used tags DELETE wt, wtt From wp_terms wt INNER JOIN wp_term_taxonomy wtt ON wt.term_id=wtt.term_id WHERE wtt.taxonomy=’post_tag’ AND wtt.count=0; Use ”’wtt.count< =1”’ to delete only tags […]

Read More…

Install LAMP on CentOS 5

=== Install LAMPĀ (Linux Apache MySQL and PHP) === yum install httpd php php-mysql mysql mysql-server chkconfig httpd on chkconfig mysqld on /etc/init.d/httpd restart /etc/init.d/mysqld restart === set MySQL root password === mysqladmin -u root -p password newpassword mysqladmin -u root -p reload === change MySQL root password (just in case) === mysqladmin -u root -p’oldpass’ […]

Read More…