Title: Database Access from the Managed WordPress website (without plugins)
Last modified: August 30, 2016

---

# Database Access from the Managed WordPress website (without plugins)

 *  Resolved [Irinna](https://wordpress.org/support/users/irinna/)
 * (@irinna)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/database-access-from-the-managed-wordpress-website-without-plugins/)
 * I have a Managed WordPress website (Twenty Sixteen theme) hosted by GoDaddy and
   want to access my MySql database from the php script within the custom page template(
   that I developed). When I try to connect using the code:
 *     ```
       <?php
       $servername = "localhost";
       $username = "username";
       $password = "password";
       $conn = new mysqli($servername, $username, $password);
       ?>
       ```
   
 *  I get the error:
    Warning: mysqli::mysqli(): (28000/1045): Access denied
 * I called GoDaddy support and got the explanation that they discourage accessing
   the database out of the phpMyAdmin environment for the safety reason (if you 
   have the Managed WP), but some people still manage to access their databases.
   Sure, I asked how and he told me that they are not providing support for something
   like that. So, is there somebody who can let me know how I can access (and modify
   some records in) my database (without using some plugin) if I have Managed WordPress
   for my website? Should I develop some kind of a plugin?? Or I would have to switch
   to the CPanel account in order to do this (as the GoDaddy support suggested)?
   Thank you very much in advance for any hint!

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Mark Ratledge](https://wordpress.org/support/users/songdogtech/)
 * (@songdogtech)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/database-access-from-the-managed-wordpress-website-without-plugins/#post-6886188)
 * Never a good idea to access a database like that; that’s why GD has security 
   measures in place to prevent it. See [https://codex.wordpress.org/Class_Reference/wpdb](https://codex.wordpress.org/Class_Reference/wpdb)
   and use the WordPress database layer to talk to the database and connect in a
   secure manner.
 *  Thread Starter [Irinna](https://wordpress.org/support/users/irinna/)
 * (@irinna)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/database-access-from-the-managed-wordpress-website-without-plugins/#post-6886194)
 * SongDogTech, thank you very much for such a fast answer! I will try your suggestion
   tomorrow and hopefully mark this topic as resolved :-)!
 *  Thread Starter [Irinna](https://wordpress.org/support/users/irinna/)
 * (@irinna)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/database-access-from-the-managed-wordpress-website-without-plugins/#post-6886317)
 * …wpdb does allow me to read/write from/to my custom table. Thank you again, songdogtech!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Database Access from the Managed WordPress website (without plugins)’
is closed to new replies.

## Tags

 * [access database](https://wordpress.org/support/topic-tag/access-database/)
 * [managed wordpress](https://wordpress.org/support/topic-tag/managed-wordpress/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [Irinna](https://wordpress.org/support/users/irinna/)
 * Last activity: [10 years, 4 months ago](https://wordpress.org/support/topic/database-access-from-the-managed-wordpress-website-without-plugins/#post-6886317)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
