Here is a workaround how you can change the DB connection on existing SQL tables in our Plugin.
For each table, during creation we have to manually select the DB connection from the dropdown;
and the only way to change that after the tables were already made by our plugin,
is to go in the database where your WordPress is,
there find our plugin's database table named 'wp_wpdatatables'.
( the wp_ is the default WordPress Database table prefix, on your site's database that table prefix might be different, but it should be easy to recognise, all tables would have the same DB prefix,
so check for "yourTablePrefix_wpdatatables")
This table holds the details and settings for each table from our plugin.
If you wish to sort it by table type, you can hit the Header of column 'table_type' and just look for 'mysql' type tables,
or you can do a "search" on wp_wpdatatables to only show this table type.
Then check under the "connection" column, here the "external DB connection" name is set.
You can edit that field for all MySQL tables you need from our plugin and change the DB connection name.
Under the "content" you will also see the SQL Query used for each table,
and of course, in the ID field, it will show each wpDataTable's ID, as they would show on the Shortcodes.
Here is an example screenshot from a user's database that has two different external DB Connections and how that looks in the table's data :
Hello, how can i change the database conecction used by already clreated tables?
I have more than 40 tables using the default "WP Connection" that run SQL queries to the WordPress database.
The system has been working great, but now i need to set the system in "read only" mode.
To do that I've created another user in the DDBB only with "Select" capabilities.
I've created a "Separate DB connection" using this new (read only) user, and is working great when i create new tables (SQL wpdatatables), but,
how can i change the DB connection used by existing tables?
If it's not possible, is there any way that i could "set in read only mode" all the tables at once?
Thanks in advance,
Roberto.
Attached files: existing tables.jpg
nueva conexion.jpg
HellI, Roberto,
Here is a workaround how you can change the DB connection on existing SQL tables in our Plugin.
For each table, during creation we have to manually select the DB connection from the dropdown;
and the only way to change that after the tables were already made by our plugin,
is to go in the database where your WordPress is,
there find our plugin's database table named 'wp_wpdatatables'.
( the wp_ is the default WordPress Database table prefix, on your site's database that table prefix might be different, but it should be easy to recognise, all tables would have the same DB prefix,
so check for "yourTablePrefix_wpdatatables")
This table holds the details and settings for each table from our plugin.
If you wish to sort it by table type, you can hit the Header of column 'table_type' and just look for 'mysql' type tables,
or you can do a "search" on wp_wpdatatables to only show this table type.
Then check under the "connection" column, here the "external DB connection" name is set.
You can edit that field for all MySQL tables you need from our plugin and change the DB connection name.
Under the "content" you will also see the SQL Query used for each table,
and of course, in the ID field, it will show each wpDataTable's ID, as they would show on the Shortcodes.
Here is an example screenshot from a user's database that has two different external DB Connections and how that looks in the table's data :
Let me know if that helps.
Thank you.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hi Miloš, thank you for the reply.
It has worked flawlessly.
Thank you so much!
Hi Roberto,
I am delighted to hear that this has been resolved. Thank you for letting us know.
Anything else that we could assist with, please don't hesitate to create new tickets.
Have a great day! :)
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables