Using a remote MySQL database for a WP install on localhost - mysql

I am trying to use a database on my SiteGround hosting account for a WP install on my localhost (where I have Apache, PHP running using DesktopServer).
I am using the IP given in Remote MySQL section of cPanel for DB_HOST. I have whitelisted my IP. Also double checked to ensure that DB_NAME, DB_USER and DB_PASSWORD are correct. Gave full permissions to the user to access that database.
When I visit the WP install page, http://local.dev/wp-admin/install.php it says "Error establishing a database connection".
I sent a support ticket to the host and they concluded that everything is fine from their end:
I added a test IP of mine to cPanel > Remote MySQL and connected successfully to your database using the credentials shown on your screen shot...Everything seems properly and you should be able to connect remotely, so if you cannot connect your local app, I suppose that there is some local issue.
Can anyone give a clue as to how I can troubleshoot this?
I am using a Mac.

Related

Connecting to a remote mySql server from my local machine

My main problem right now is that I can't connect to the remote mysql server while developing on my machine. I'm trying to update a website that was previously developed by someone I do not know. I've been editing the site on my local machine but I need to access data from the mysql database that it has been using. I have the username and password that the site uses to connect to the mysql server. I can connect to it through phpmyadmin but I would like to work locally without publishing my edits to the server.
I found this here in SO and I tried running the scripts in phpmyadmin using my pc's IPaddress but I keep getting
Access denied for user 'username'#'localhost' (using password: YES)
even though I'm 100% sure I'm using the password that I used to login to phpmyadmin. I tried creating a new user but the login I'm using doesn't seem to have a Create User privilege either.
I understand that the previous developer might have a different "admin" account that has all the privileges but I have no way of knowing either.
I am a C# developer but I'm really new to MySql. Any help is greatly appreciated.
This may be a firewall issue. phpmyadmin listens on port 80 by default, but mySQL listens on port 3306. Please check the firewalls on your local PC (to make sure you can get out on 3306) and the server (to make sure you can get in on 3306).

DB connection error while installing Wordpress in a local easyphp server

I am trying to get a local server to test Wordpress, so I have installed easyphp Devserver 17.0 in my PC (Windows OS),
I have downloaded Wordpress code from Wordpress.org, paste it in \EasyPHP-Devserver-17\eds-www and followed step by step Wordpress installation instructions (https://codex.wordpress.org/Installing_WordPress#Famous_5-Minute_Install).
Problem is:
when I access to my localhost server and wordpress folder, it starts wordpress installation and it ask for my database info (name, user, pass, host...) and I use "120.0.0.1" or "localhost" (my DB sever according to phpMyAdmin) as host, wordpress shows a failed-to-connect-to-DB error.
I've tried to use add DB Server port to host (127.0.0.1:3306), checked my http and DB servers are working, checked the other data is all correct and the answer is still the same.
Anyone could help?
I resolved the problem by changing WordPress user host from % to localhost in the database.

Connecting to CPanel Database

i'm trying to connect to a CPanel database on a remote server from my Laptop's SequelPro, it's not working and i have no idea why, i've set the remote access to be the '%' wildcard, so my specific machine shouldn't matter
I'm using the domain name of the site and i've used the correct username and password for a user i created on my CPanel's DB... what am i doing wrong? Or am i overlooking some detail?
It should just login with the domain and user credentials right?
Please ask your hosting providers if they do allow remote mysql connections to their mysql server. Most of the providers don't. You could test that by doing a telnet connection on the mysql server's ip address, portt 3306.
telnet mysql-server-ip 3306
If you can connect then they do allow incoming mysql connections from the internet to their server. If not, then there is nothing you can do. Just write them, explain your problem and see what they say.
Login to cPanel and go to MySQL Databases. Check if there's any remote mysql server shown there. If not, most probably the MySQL runs locally on the cPanel server the mysql server ip = the cPanel server ip. If you go to
cPanel -> Remote MySQL you can add there your ip address or the ip you're connecting to. That might fix your issue...

How to access my newly setup MySQL database (getting "Domain is currently unable to handle this request.")

I just set up a new MySQL database with the MySQL workbench & created a user for it with all necessary privileges. I am using this database for use with my php code. But I can't seem to connect to it on my live server (pages are hosted on windows server 2012). Everything works fine in my local environment with xampp and the new MySQL database is exactly the same as the xampp one. I think I am maybe using the wrong host name or something. As host name I copied the name that is displayed after "Host:" when you click on Server Status in MySQL workbench. The database name, user & password should all be correct. But when my code tries to access the db I get a "The domain page isn’t working. Domain is currently unable to handle this request."
You either have no network connection to the server at all or it is blocked due to firewall or routing misconfiguration.
If you do have network access in general, you might forgot to
FLUSH PRIVILEGES;
or you have not enabled networking over TCP, the default is to listen only to localhost (on unix systems via unix sockets, on microsoft I guess it's simply TCP).
Read about the following configuration parameter which will solve your networking issue:
bind-address
If you have a very old MySQL server version, the parameter is enable-networking but it shouldn't be the case anymore.

Connect to database using Workbench

I have a database on my server and I want to connect to it through MySql Workbench, I entered my HostName, Username, Password, When I click Test Connection I get this Error Message:
Failed to Connect to MYSQL at **.**.***.**:3306 with user root.
Host '**.171.199.66' is not allowed to connect to this MySQL server
I am 100% sure my Hostname, username and Password are correct, I did some research and from what I managed to find out that I have to actually permit an access from my IP address to the database before I can connect.....if this is correct could someone explain to me how to give myself e permission to connect to my database on server.
It is likely that your MySql root account is configured to not accept remote root logins (its a default). If you are trying to connect from anywhere but localhost its not going to allow it. Your're right you need to permit access for your IP. You need to do it from within the server your MySql is installed on. In case of if you have managed hosting, your hosting company should provide you with a tool like phpMyAdmin or such, to manage your MySql. If it is your own installation, you can connect to mysql server instance from the console and go from there.
Check out another stackoverflow post:
Here is what you should be looking for in phpMyAdmin:
Keep in mind it might look a bit different depending on the phpMyAdmin Version.