• Hi, I recently moved my working wordpress site to a new server (Redhat7.5) to a private net so it’s not accessible through internet. The problem is that I can’t access to the admin area with my administrator account (usr: admin pswd:asdf). I’ve tried the following:
    https://codex.www.ads-software.com/Login_Trouble

    https://www.ads-software.com/support/topic/cant-login-to-wp-admin-dashboard-2/

    In a few words I renamed my plugins folder, my theme folder but still no answer. I’m pretty sure that WP can access the database. I’ve also activated the logs with the debug mode in my wp_config file:
    $table_prefix = ‘wp_’;
    define(‘FORCE_SSL_ADMIN’, true);
    define(‘WP_DEBUG’, true);
    define(‘WP_DEBUG_LOG’, true);

    But still not getting the error message, Sometimes it returns a message saying the following:

    [16-Nov-2018 13:40:48 UTC] PHP Warning: An unexpected error occurred. Something may be wrong with www.ads-software.com or this server’s configuration. If you continue to have problems, please try the support forums. (WordPress could not establish a secure connection to www.ads-software.com. Please contact your server administrator.) in /opt/appl/prod1/wp-includes/update.php on line 529

    I don’t think that has anything to do with my problem because this file worked perfect in the other server. I’ve also made it sure that the hosts file is correctly configured , Is there something I’m missing? Maybe I should connect to the database with the administrator credentials?

    As far as I know wordpress executes successfully the query:
    UPDATE wp_usermeta SET meta_value = ‘a:7:{s:64:\”09…….;s:2:\”ua\…;}}’ WHERE user_id = 1 AND meta_key = ‘session_tokens’

    Please I need help with this I’ve tried Everyting

Viewing 5 replies - 1 through 5 (of 5 total)
  • Renu Sharma

    (@renusharma23july)

    Just create a new user using database query directly in database.

    Below is the code to create a new admin account named newadmin with the password pass123. Note: We assume your database wp prefix is default.

    INSERT INTO wp_users (user_login, user_pass, user_nicename, user_email, user_status)
    VALUES (‘newadmin’, MD5(‘pass123’), ‘firstname lastname’, ’[email protected]’, ‘0’);

    INSERT INTO wp_usermeta (umeta_id, user_id, meta_key, meta_value)
    VALUES (NULL, (Select max(id) FROM wp_users), ‘wp_capabilities’, ‘a:1:{s:13:”administrator”;s:1:”1″;}’);

    INSERT INTO wp_usermeta (umeta_id, user_id, meta_key, meta_value)
    VALUES (NULL, (Select max(id) FROM wp_users), ‘wp_user_level’, ’10’);

    Thread Starter estoespersonal

    (@estoespersonal)

    Hi, Renu
    Thanks for your reply.
    I finally inserted the new user but the problem is still the same, the admin user is not able to login into the admin area. It redirects me continuously to the https:mydomain/wp-login.php area. I’m quite sure it’s something with the database, beceause yestaerday I’ve changed the collation from utf8mb4_general_ci to utf8mb4_unicode_ci

    I’ve tried to execute the second query but it returns me the following error:
    INSERT INTO wp_usermeta (umeta_id, user_id, meta_key, meta_value)
    VALUES (NULL, (Select max(id) FROM wp_users), ‘wp_capabilities’, ‘a:1:{s:13:”administrator”;s:1:”1″;}’);

    Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8mb4_general_ci,IMPLICIT) for operation ‘strcmp’

    I’ve checked the collation of the database and change it to: utf8mb4_unicode_ci
    The table usersmeta has utf8mb4_unicode_ci collation and also the columns meta_key, meta_value. What I’m doing wrong?

    My phpmyadmin version is 4.7.9 and I’m using php 7.2 version

    Regards

    Renu Sharma

    (@renusharma23july)

    Could you please share your site url?

    Thread Starter estoespersonal

    (@estoespersonal)

    Hi, Renu

    Sadly my site is in a server that has no public internet access, so it’s in a private network for security reasons. What I’ve tried recently is changing the collate of the following tables:
    ALTER TABLE wp_usermeta MODIFY meta_value VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
    ALTER TABLE wp_usermeta MODIFY meta_value VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    ALTER TABLE wp_usermeta MODIFY meta_key VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    ALTER TABLE wp_users CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    ALTER TABLE wp_usermeta CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    ALTER TABLE wp_options CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    ALTER TABLE wp_postmeta CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    ALTER TABLE wp_aryo_activity_log CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    ALTER TABLE wp_comments CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    ALTER TABLE wp_commentmeta CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    ALTER TABLE wp_posts CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    ALTER TABLE wp_redirection_404 CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    ALTER TABLE wp_redirection_groups CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    ALTER TABLE wp_redirection_items CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    ALTER TABLE wp_redirection_logs CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    ALTER TABLE wp_snippets CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    ALTER TABLE wp_redirection_items CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    ALTER TABLE wp_termmeta CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    ALTER TABLE wp_terms CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    ALTER TABLE wp_term_relationships CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    ALTER TABLE wp_term_taxonomy CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

    But it still doesn′t work. Do you know which fixes I’ve got to do in order to get my app running again? As I said it’s working in my preproduction server but when I migrated everything to the production server it crashes.

    If you want I can show you the wp-config.php file but I’m pretty sure it has something to do with the database because if I try to login with the “newadmin” user and a mistaken password like “badpswd” it shows a message telling me that my password is incorrect.

    What else can I do?

    Thread Starter estoespersonal

    (@estoespersonal)

    I finnaly fixed it, the problem was with the collation of the column meta_value had a type of varchar(255), I’ve changed it to longtext and it worked again.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Can’t login to Admin panel after migrating to new server’ is closed to new replies.