-
I have this same issue:
https://support.rankmath.com/ticket/missing-tables/This is on a fresh install. I can see in the error log that table wpj_rank_math_redirections doesn’t exist.
- This topic was modified 4 years, 6 months ago by Jorge.
-
I’ve tried deactivating and reactivating the plugin, deactivating and reactivating the redirections plugin, no luck.
Redirections are not imported and they can’t be created either.
Hello,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
Hello,
Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.
I have checked your site but I couldn’t replicate the issue. I enabled the redirection module while checking and disabled it afterwards. I however noticed you have a standalone redirection plugin enabled. Please share a screencast of your issue and make sure to have only one redirection plugin enabled to rule out conflict.
Looking forward to helping you. Thank you.
​​​​​​​
Hi Michael,
Sorry if my description wasn’t accurate. Try to create a redirection, any redirection. It won’t work. No redirections will appear in the list
Try to import the redirections from the existing Redirection plugin. It’ll say 5 redirections have been imported, but they won’t be created, the list will be empty.
If I check the error_log file from PHP, I can see that the table doesn’t exist:
Error Table ‘DATABASENAME.TABLEPREFIX_rank_math_redirections’ doesn’t exist de la base de datos de WordPress para la consulta select * from wpj_rank_math_redirections where status = ‘active’ order by updated desc realizada por require(‘wp-blog-header.php’), wp, WP->main, do_action_ref_array(‘wp’), WP_Hook->do_action, WP_Hook->apply_filters, RankMath\Redirections\Redirections->do_redirection, RankMath\Redirections\Redirector->__construct, RankMath\Redirections\Redirector->flow, RankMath\Redirections\Redirector->everything, RankMath\Redirections\DB::match_redirections, RankMath\Redirections\DB::match_redirections, MyThemeShop\Database\Query_Builder->get
Sorry my PHP error log is in Spanish.
Hello,
Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.
I have been able to replicate your issue, allow me to consult with the dev team and investigate this issue further, In the meantime please keep the temporary access open.
Looking forward to helping you. Thank you.
​​​​​​​
Hi,
Could you please run this SQL query to create the missing redirections table?
https://support.rankmath.com/ticket/split-redirections-arent-being-added/?view=all#post-54783
If you would like us to do that, please share your cPanel or MySQL logins so we can do it for you.
I’m getting another error when running the SQL:
#1072 – La columna clave ‘status’ no existe en la tabla
Translated: the key column ‘status’ doesn’t exist in the table.
Hello Jorge,
Please share your cPanel or MySQL/phpMyAdmin logins so we can fix this issue for you.
Hello,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
By the way, since I’ve provided access data, maybe you can work on my activation issue too? This thread -> https://support.rankmath.com/ticket/activation-issue-2/page/2/?view=all
The latest version doesn’t get activated and Search Console connection doesn’t work.
If it’s better to open a separate one, let me know.
Hello,
Can you please get in touch with your hosting team and ask them why the default charset is showing null on your site? You can define charset in WP_DEBUG file but I am not sure what charset your site is using show I didn’t add any code.
For now, I have manually run the query in PHPMyAdmin with utf8 charset and that seemed to have fixed the issue. I see the tables are now created on your site’s Database.
I hope that helps.
This site is very old, probably comes from WordPress 3. I can see that the database default collation is latin1_swedish_ci, which was the norm many years ago. Most tables also have this collation, and I can see newer tables with utf8_general_ci. And then your newly created tables with utf8mb4_unicode_ci.
I can’t see too many benefits in transcoding all the tables to utf8 at this point, since nothing is broken, and it’s kind of a big task.
RankMath is still not getting activated, by the way.
Well, I’m not sure what you did but I’ve lost many of my configuration options. The theme’s logo, widgets, some menus, etc. I’m going to need to recreate this from a backup, and this will mean starting from scratch with your fix. Oh well.
Ok, I’ve solved this. RankMath, as of now, is incompatible with older WordPress installs from the “pre UTF-8” era. That’s why redirection tables are not correctly created. My wp-config.php was also quite ancient, very short and with no charset definitions at all.
This seems to have a relationship with the activation issue as well, but I’m not sure. After a lot of fiddling with the plugin it seems its keeping the connection. I will update the other ticket accordingly.
What I did: I found a script that converts databases from latin1 to UTF8. Made a copy of the database, run the script, and changed the collating of the tables and database to utf8mb4_unicode_ci. I also updated my wp-config.php to the current version.
I then had to deactivate and reactivate Rank Math so tables would be correctly created. After that, I could create redirections as well as import them from the Redirection plugin.
I’m posting the code I used with no guarantees. You need to enter the database user, password and database name.
<?php /** * Requires php >= 5.5 * * Use this script to convert utf-8 data in utf-8 mysql tables stored via latin1 connection * This is a PHP port from: https://gist.github.com/njvack/6113127 * * @link : http://www.ridesidecar.com/2013/07/30/of-databases-and-character-encodings/ * * BACKUP YOUR DATABASE BEFORE YOU RUN THIS SCRIPT! * * Once the script ran over your databases, change your database connection charset to utf8: * * $dsn = 'mysql:host=localhost;port=3306;charset=utf8'; * * DON'T RUN THIS SCRIPT MORE THAN ONCE! * * @author hollodotme */ header('Content-Type: text/plain; charset=utf-8'); $dsn = 'mysql:host=localhost;port=3306;charset=latin1'; $user = 'DATABASEUSER'; $password = 'PASSWORD'; $options = [ \PDO::ATTR_CURSOR => \PDO::CURSOR_FWDONLY, \PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true, \PDO::MYSQL_ATTR_INIT_COMMAND => "SET CHARACTER SET latin1", ]; $dbManager = new \PDO( $dsn, $user, $password, $options ); $databasesToConvert = [ 'DATABASE', /** database3, ... */ ]; $typesToConvert = [ 'char', 'varchar', 'tinytext', 'mediumtext', 'text', 'longtext' ]; foreach ( $databasesToConvert as $database ) { echo $database, ":\n"; echo str_repeat( '=', strlen( $database ) + 1 ), "\n"; $dbManager->exec( "USE <code>{$database}</code>" ); $tablesStatement = $dbManager->query( "SHOW TABLES" ); while ( ($table = $tablesStatement->fetchColumn()) ) { echo "Table: {$table}:\n"; echo str_repeat( '-', strlen( $table ) + 8 ), "\n"; $columnsToConvert = [ ]; $columsStatement = $dbManager->query( "DESCRIBE <code>{$table}</code>" ); while ( ($tableInfo = $columsStatement->fetch( \PDO::FETCH_ASSOC )) ) { $column = $tableInfo['Field']; echo ' * ' . $column . ': ' . $tableInfo['Type']; $type = preg_replace( "#\(\d+\)#", '', $tableInfo['Type'] ); if ( in_array( $type, $typesToConvert ) ) { echo " => must be converted\n"; $columnsToConvert[] = $column; } else { echo " => not relevant\n"; } } if ( !empty($columnsToConvert) ) { $converts = array_map( function ( $column ) { return "<code>{$column}</code> = CONVERT(CAST(CONVERT(<code>{$column}</code> USING latin1) AS binary) USING utf8)"; }, $columnsToConvert ); $query = "UPDATE <code>{$table}</code> SET " . join( ', ', $converts ); echo "\n", $query, "\n"; $dbManager->exec( $query ); } echo "\n--\n"; } echo "\n"; }
Hello,
Thank you for sharing your discoveries. I will send this to the dev team so they can take a look and check it in depth. Again, thank you for letting us know about it.
Looking forward to help you.
Hello,
Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.
If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.
Thank you.
The ticket ‘Missing tables in redirections’ is closed to new replies.