How to Create a Admin User for A WordPress Site via MySQL (PHPMyAdmin)?

You need to run those below queries- INSERT INTO `your-wp-database`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_status`, `display_name`) VALUES (‘1000’, ‘your_username’, MD5(‘Str0ngPa55!’), ‘your_username’, ‘[email protected]’, ‘0’, ‘User Display Name’); INSERT INTO `your-wp-database`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, ‘1000’, ‘wp_capabilities’, ‘a:1:{s:13:”administrator”;b:1;}’); INSERT INTO `your-wp-database`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, ‘1000’, ‘wp_user_level’, ’10’); But notice here your-wp-database … Read more

How can I restore admin capabilities?

The string below actually represents an array in serialized form. a:1:{s:13:”administrator”;s:1:”1″;} Here: a:1 means an array with a single element s:13 means string and the length of the string followed by Array { “administrator” => “1” } Once that is in the table, you can use the unserialize() function to return it to an array … Read more

$wpdb->query() vs. $wpdb->get_results() vs. phpMyAdmin

The difference is what is returned. The WPDB query() method returns true for CREATE, ALTER, TRUNCATE and DROP queries, an integer of how many results for all other queries, or simply false if if there’s an error. The WPDB get_results() method actually returns the entire result of the query (like you would get running the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)