ERROR! MySQL server PID file could not be found!

Dec03

If you are getting below Error message:-
ERROR! MySQL server PID file could not be found!
Starting MySQL… ERROR! The server quit without updating PID file (/var/lib/mysql/xxxx.com.pid).

Login to the server as a root user with SSH

Create the directory as /var/run/mysql

[root@office1 ~]# mkdir /var/run/mysql

Now create  file mysqld.pid

[root@office1 ~]#touch mysqld.pid

and change its ownership to  mysql:mysql

[root@office1 ~]#chown mysql:mysql mysqld.pid

Now try to Restart MySQL service and its restarted successfull 😀 ?

MYSQL command to manage WordPress Database

Aug12

Below is very usefull commands of WordPress using MYSQL shell :-
1) first login as a Root and access your database using your database login

root@data[~]# mysql -u DB_USER -p
Enter password:

2) Use your Database 
mysql> use DB_NAME;

3)To check the current theme in wordpress :-
mysql> SELECT * FROM `wp_options` WHERE `option_name` = ‘current_theme’;

4)To check the siteurl link :-
mysql> select * from wp_options where option_name = ‘siteurl’;

5)To check the home URL link :-
   mysql> select * from wp_options where option_name = ‘home’;

6)To change the “siteurl” and “home” URL :-
mysql>  UPDATE wp_options SET option_value = replace(option_value, ‘http://current url ‘, ‘http://New URL’) WHERE option_name = ‘home’ OR option_name = ‘siteurl’;

7)To check how many users in wordpress :-
   mysql> select * from wp_users where user_login like ‘%’;

8)To change the user-password :-
mysql>  UPDATE `wp_users` SET `user_pass` = MD5( ‘12345678’ ) WHERE `wp_users`.`ID` =1;     —–> ID represent diffrent users.

9)Show all tables in the database:-
   mysql> show tables;
+—————————+
| Tables_in_DB_NAME |
+—————————+
| wp_commentmeta            |
| wp_comments               |
| wp_links                  |
| wp_options                |
| wp_postmeta               |
| wp_posts                  |
| wp_term_relationships     |
| wp_term_taxonomy          |
| wp_terms                  |
| wp_usermeta               |
| wp_users                  |
+—————————+
11 rows in set (0.00 sec)

11) Description about the tabel :-
mysql> describe wp_users;

Enjoy in easy way 😀

 

Error : #1045 Cannot log in to the MySQL server

Jul09

Getting the following error while trying to access phpmyadmin from within cpanel :

#1045 Cannot log in to the MySQL server

Solution :

Please change the cpanel username from within cpanel. make sure that “Allow MySQL password change” check box is selected while changing the password.
Sidebar