Well it’s really not good practise, but this depends on how you’re accessing the other databases.
For example, I have a server that hosts 10+ different WordPress sites.
I have two options for connecting to the databases:
- Use the root login in all my wp-config.php files as it’s easier
- Create a user and logins associated with each database for each site
Number 1 is useful when I’m developing locally/on a virtual machine as the databases aren’t accessible to the outside world.
Number 2 is definitely the best practise when you’re running a live server with multiple databases. At most if your password does get compromised you’re only exposing one database.
Related Posts:
- Using wpdb to connect to a separate database
- How to fetch Data in WordPress using MySQLi or $wpdb
- wpdb->insert multiple record at once
- How to define composite keys with dbDelta()
- Inserting Post Meta From SQL
- Why does dbDelta() not catch MysqlErrors?
- What causes the “max_user_connections” warning on WordPress frontend?
- How to execute mulitple statement SQL queries using $wpdb->query?
- Database slowdown after update to 3.4.1
- wpdb_prepare with multiple or condition
- WordPress database error – Error in SQL syntax – I can’t identify any error?
- Advanced SELECT query with condtional statements
- Redirecting to old domain after migration website
- Create table from array with prepare
- WordPress running SQL query to update database from form
- Have working sql query… trying to adjust it to use $wpdb
- Custom WordPress Table wpdb
- Best practice to limit results in get_row()?
- Trouble running $wpdb->query() with last_insert_id
- Query Column of Specific ID from Database Table
- How to create more than one new wpdb object?
- How to connect and insert data in database of wordpress?
- How to escape percentage sign(%) in sql query with $wpdb->prepare?
- “BS_” rows in postmeta table
- Where is the HTML-handler part in the wpdb class?
- WordPress Database Query works in phpMyAdmin but not in the code
- insert data from a form:: Warning Empty query mysqli::query()
- How can I get $wpdb to show MySQL warnings?
- How To connect to the same WordPress database with different database user
- Uploading to WordPress Database
- Rename a table in MySQL
- How should I tackle –secure-file-priv in MySQL?
- Can’t connect to MySQL server on ‘127.0.0.1’ (10061) (2003)
- Checking if Database Table exists
- Connect to database using wordpress wp-config file
- How To Export/Import WordPress (MySQL) Database Properly Via Command-Line?
- Does wpdb add considerable overhead on queries with large result sets?
- Is it possible to define two databases for one installation?
- Hook into $wpdb
- Display data from a non wordpress database on a page template
- Connecting to external oracle database
- Huge wp_options table
- “MySQL server has gone away” since update to 3.8
- Can’t save ajax value to database
- Updating all rows of table with $wpdb
- Is $wpdb->prepare escaping to much? How to use it properly?
- Can I transfer a mysql database to another site?
- MySQL Syntax Error upon restoring database from backup [closed]
- Help running a MySQL query to update all wp_#_options tables in a Multisite install
- Remove database entries where post_date > expiration date
- Is it safe to convert tables from MyISAM to InnoDB?
- Emojis getting converted to “?”
- How to use a different database to list and manage comments in the backend
- How do I properly update the WordPress database password?
- $wpdb->insert is not working
- WordPress Install and Database on separate hosting?
- wpdb custom post_type problem
- In what part of the WordPress core does the users table and usermeta table get joined?
- WordPress and MySQL: how to transfer Meta_key and Meta_Value from one post_id to another
- Using GROUP CONCAT in my-sql query with wp_usermeta table
- Help With MySQL to WPDB Query Conversion
- Migrating from PDO using SQLite to clean new install using MySQL
- $wpdb->insert Giving duplicates
- Duplicated site isn’t recognized as a site
- after wordpress update to 3.5+ i get many errors in plugin wpdb::prepare()
- Changing root password in PHPMyAdmin for WordPress Database when going live
- How to properly check if a table exists in WordPress Database using Show Tables Query
- Can’t update WordFence Options, clear data manually
- How to fetch records from database WordPress
- How and where is wordpress adding mySQL content to database?
- AJAX wp-mysql running too slow
- How to delete a particular row in a database table
- Files on Localhost, Database on Server
- Remote database -> massive response time increase?
- Getting “Error Establishing a Database Connection” on localhost in new Mac OSX Lion environment
- How do I have a user upload a blog post and then retrieve that to display in a card on the site?
- DB prefix not updating
- Replacing javascript link in WordPress database without getting mysql syntax errors
- How to edit custom table data in frontend
- Writing a function for WP Cron to run a SQL command daily
- local wordpress broke after changing URL
- how to access 2nd Mysqli Database from different server for wordpress
- Error establishing a database connection – WordPress setup, everything else is working
- Help posting values to DB on submit using $wpdb->query
- How to map data on CSV to web pages?
- How to add download link from database on custom page template?
- How to create index (sql) to a meta_key?
- Search and Replace in Windows XAMPP site
- WPCLI search and replace in a particlar site dir effect another site-dir
- How can i syn wordpress user table with a stand-alone php script?
- How to get specific table by current user login
- Accessing content from third party as native posts in WordPress
- WordPress Database Posts Table query
- Hang Up Followed By Can’t select database
- Mysql Queries per Visit – Crazy High
- Pulling values from a sepcific row in table
- Inserting into data into external DB using WPDB
- Insert Extra fields added in the front end registration form to DB
- export individual posts to text files or a single csv file
- $wpdb->insert not working for last select option