0

I am using the wpDataTables plugin on WordPress. I am trying to connect to a MySQL database on my local machine. It asks for server, port, database name, user, and password. No matter what I try, I get one of two errors:

wpDataTables could not connect to mysql server. mysql said: There was a problem with your SQL connection - Access denied for user ''@'%' to database 'storm' " using 127.0.0.1 as host

wpDataTables could not connect to mysql server. mysql said: There was a problem with your SQL connection - No such file or directory" trying to use 'localhost' as host

I use MySQL an application called TablePlus on my MacBook.

I have tried changing authentication string for the root user, created users and changed their authentication string. Yet nothing still works.

I have tried select * from mysql.user and saw the users and their privileges and none of the information I plugin in there works.

Community
  • 1
  • 1
  • 5
    `Access denied for user ''@'%' ` sounds like you're not passing a username at all. If this is a WP-plugin, why does it need it's own db-connection instead of reusing WP's connection? That doesn't really make sense. – M. Eriksson Aug 15 '19 at 12:53
  • Hi Magnus, even when I enter a user (for example 'root') it gives that error message, and I am trying to connect to a local MySQL server on my local mac not WPs default MySQL server on PHPMyAdmin – Storm Falcon Aug 15 '19 at 13:06
  • 1
    In the [documentation](https://wpdatatables.com/documentation/general/configuration/) for wpDataTables, it says: _"Enable this setting if you want to build tables using data from a database or host different from the one you use for your WordPress installation. **Do not check this checkbox if you want to use the WordPress database connection.**"_. Unless you need to use a different database for this, uncheck that checkbox and let the plugin reuse WP's connection. Having multiple database connection to the same database is bad for performance. – M. Eriksson Aug 15 '19 at 13:07
  • 1
    _"to a local MySQL server on my local mac not WPs default MySQL server on PHPMyAdmin"_ - PHPMyAdmin isn't a database and doesn't contain a database. It's simply a web based management tool for MySQL databases. – M. Eriksson Aug 15 '19 at 13:08
  • Thanks for the responses Magnus. I have that checked on because I want to use a different host for my personal MySQL on my MacBook, but every time I get an error that access to the user is denied, even with the right privileges, password & everything. – Storm Falcon Aug 15 '19 at 13:22
  • What database does your wordpress use? Is it a remote database (e.i not `127.0.0.1` or `localhost`)? And why do you want to use a different database? Isn't wpDataTables a part of the same site/application? – M. Eriksson Aug 15 '19 at 13:27
  • If i go to phpMyAdmin the Database is 149340447 on 127.0.0.1. However I created a server on my MacBook on localhost called 'icestorm' and within that server created a database called 'storm' which has tables in that I want to load. If that makes sense. THANK YOU! – Storm Falcon Aug 15 '19 at 13:34
  • And where is PHPMyAdmin? On your computer? Then it is the local database. `127.0.0.1` (which usually is the same as `localhost`). is your computer. However, I'm still not clear _why_ you want to use different databases for different parts of your app. What problem are you trying to solve by doing that? – M. Eriksson Aug 15 '19 at 13:38
  • I added the PHPMyAdmin wordpress plugin. The link looks like: https://hockeyicestorm.com/wp-content/plugins/wp-phpmyadmin-extension/lib/phpMyAdmin_EWCfnZ5vMPSpkh7dHxwzIJ1/db_structure.php?server=1&db=149340447 The reason I want to use a different database is because is because all my tables are in that one. The database WP gave me has none of the hockey data I want to use, just tables like wp_links, wp_users. – Storm Falcon Aug 15 '19 at 13:45
  • So set WP to use the same database? – M. Eriksson Aug 15 '19 at 13:48
  • Yes that is what I want to do, but unfortunately I get the errors above. :( – Storm Falcon Aug 15 '19 at 13:54

0 Answers0