//Params to connect to a database
$dbHost = "*static ip of wordpress site*";
This should be $dbHost = "localhost"; instead, or "127.0.0.1" (or even "::1").
localhost uses a separate virtual network interface that makes sure traffic between services on your Linux VM doesn’t leave the VM In general it’s safer to use localhost rather than other IPs that belong to host interfaces because
- you’ll avoid any problems with firewalls that might be configured on the host
- ditto in an AWS environment you’ll avoid any security group / VPC filters, if e.g. you were using the public facing IP as your host rather than the internal IP address on the virtual private cloud which is different
- mysql logins can be filtered by the hosts they’re allowed to connect from, and if your root user may be restricted to localhost logins at the database level.
Related Posts:
- Undefined function mysql_connect()
- MySQL column count doesn’t match value count at row 1 [closed]
- dbDelta support for FOREIGN KEY
- is it possible to run some php code within a wordpress page?
- How to correctly submit a search form and display the result in an independent page
- Check if post of title already exists
- $wpdb->delete column values IN ARRAY()?
- Custom SQL query to get List of posts with featured image url
- Does WordPress cache get_user_meta() results?
- Delete post revisions on post publish
- Using Echo in ShortCode – Stuck
- Problems migrating WordPress to localhost
- error importing localhost export file to server
- How to sort results from a custom database table
- Update some database fields when post is saved
- sql query to put quotes around numbers in img tag
- No wp-config.php file on local install of wordpress – site still displays
- Use ajax to update_post_meta
- What SQL / WordPress queries would need a nonce?
- Different database query in function.php using mysqli
- Strange wordpress slowness
- Setting All Drafts to ‘exclude-from-catalog’ in WooCommerce
- Why is variable not working on custom sql query using wpdb?
- How can I export posts with featured images, without download them
- How to securely provide a $_POST var in WP_Query with PHP 7?
- Create WP_Query to search for posts by their categories or their parent/child categories
- WSoD being caused by this piece of code
- How to display data from custom table in wordpress phpmyadmin
- Update results, Before deleting the related category [closed]
- Sum the total amount of a specific product purchased per user and display in table
- get_posts() and WP_query limits ‘AND’ conditions to a maximum of 6 for meta value queries in WordPress
- Replacing mysql_escape_string in a custom plugin when moving to PHP7
- Weird 404 URL Problem – domain name being placed at end of urls
- database sent to a JSON file
- $wpdb->insert() does not Insert record in a table
- Help with a $wpdb MySQL Query
- How i can obtain all the post meta for a specific post as an array?
- multiple where condition in result query
- Can’t Query Custom Table Using $wpdb Method
- $wpdb returns duplicate posts
- Update postmeta after theme switch
- Should I use WordPress to skin a database website?
- Creating Database Table vs. Adding MetaData to Post & User
- WordPress Custom SQL Table with UserID Filter for results
- How can I add a new row in a separate database when someone registers via WordPress?
- I can’t update my data through $wpdb
- How to use mysql LIKE with wpdb?
- Submitting a form, using Ajax, to run a SQL Select query based on user input from the form
- WordPress WP_Query without query GET parameters
- How to use AJAX in WordPress in MYSQL query?
- Use variable in SQL statement
- Processing ajax call to php to insert into mysql database
- WPDB secure custom form
- Query the links Database
- WordPress Custom Query: Combining Two Functions
- MySQL Query Returns Array () In Shortcode
- How to WP_Query posts order by parent title?
- Passing in MySQL prepare statement parameter separately throwing error
- Database SQL query error
- Display Results of SQL Query on WP site
- MYSQL TIMESTAMP when adding DATE_FORMAT then the output is blank, PHP conflict?
- Updated Php version from 5.4 to 7.2 and getting “PHP installation missing the MySQL extension needed by WordPress”
- Conditional formatting on data fetched from MYSQL
- Can I split a huge wp_postmeta table across different databases or servers?
- how to get data from two different table from wordpress database
- Passing Current User ID into SQL statement
- How to optimize and reduce excessive database queries
- How to insert multiple rows and columns in database using array
- Store GA Client ID in User DB
- PHP 7.2.18 | Your PHP installation appears to be missing the MySQL extension which is required by WordPress
- Windows Setup: Error establishing a database connection
- Need help with format of nested array in MySQL
- WP + MySql db / PHP
- WAMP SERVER Command Prompt SET PATH=%PATH%
- Inserting other fields to existing registration form in a WordPress theme
- Advanced WordPress SQL Query
- Splitting table data to pages with numbers
- How can get all users by current user meta (array)?
- Site doesnt work once PHP changed to 7.1
- How to detect if a revision was made by woocommerce or wordpress?
- WordPress WPDB::insert 13th param is always blank (only if format)
- Ajax not updating to database
- can’t delete a row from post_meta table
- Send data from plugin to external database
- MySQL query in WordPress with AJAX
- Processing forms with php to wordpress database
- directorypress theme error mysql_error() [closed]
- How to connect database table to each registered wordpress user.
- retrieve wordpress post-meta using php not wordpress functions
- Splash pages on a high traffic site
- Using the same shortcode to show any table from the database
- I am unable to fetch json data from wp_db
- Submit cf7 form to cfdb as pdf/BLOB [closed]
- Parse error: syntax error, unexpected ‘}’ in C:\xampp\htdocs\admin\products.php on line 148 [closed]
- How to send push notification in android using php? [closed]
- Getting invalid user ID error when creating a new user with wp_insert_user
- Custom form that stores data in mysql database
- Putting form result in my database
- How can I update a value of a field depending on outside source?
- WordPress Query with meta_key and order by another meta_key