Issue with connecting to database on Wordpress - mysql

I am trying to get Wordpress up and running but I get the "Error establishing a database connection" page pop up.
Here is the setup and what I've done:
I have a server running Wordpress fine. I took a snapshot from the AWS volume that had the wp-config.php information from the running server and spawned a new server with a volume that is snapshotted. I've checked all my settings and it all looks fine.
On the SQL sever side (MYSQL), I added the new IP with all the correct username/passwords so the database server will allow it to connect. I also have put print statements while wordpress tries to load the database. The values returned are all correct. Based on some threads I read, I also deleted my wp-config file and re-copied it from the original server.
I also made sure the permissions are correct. Any other suggestions on what I could be missing?

I was able to fix this. The issue had nothing to do with Wordpress or the server, but with MYSQL. The database have Schema privileges and I hadn't set it for my new IP address. Adding the privileges fixed the issue.

Related

Trying to connect to a mySQL db on Amazon AWS using mySQL Workbench

I just opened an account on Amazon AWS. In this account, I created a mysql database instance, that I am now trying to connect to on my home computer use mySQL Workbench. I have entered the database endpoint (as listed in my account) and added the user name I set up for the master username for the database. When I hit "test connection" (using standard TCP/IP connection) however, I get a "Failed to connect..." message. I have a feeling that the problem may be that I need to use SSL and/or SSH. But I am a neophyte here, and I don't know how to properly set this up or configure mySQL Workbench with this. I am seeking assistance
You need to allow your mysql server to the user my user policy.
You can allow your Public IP address.
Please refer below case:
Cannot ping AWS EC2 instance
I think there that my database instance was misconfigured somehow, though not as JERRY suggests. I created a new MySQL DB instance and was able to connect to that without needing any other special configuration changes. So I am now using the new instance, and have deleted the old one. I wish I could provide more insight into what the problem with the first DB was, but the insight I have is (as I said) after I created the 2nd DB instance, no other configuration was necessary

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.

mysql user from other host failing unsure why

i've setup a new mysql user on a server that allows access from other servers. i can access it from my dev machine using the credentials i setup.
But on one of my other servers nothing happens when trying to log into mysql using the same credentials that worked on my dev box. any ideas what it might be?
all it does is hang.
Nothing gets added to log files on either the new DB server or the one i'm trying to access from.
i also tested this connection from another server, just to test if my dev box was a fluke andi could access. So all i can think is there's something "wrong" with the server i cant access from.
Please post your query that executes to create this user and privileges.
If you can’t remember the queries you can execute this in your target server to get details about user
SHOW GRANTS for 'root'#'localhost';
You may check these things also .
Firewall setup for the server from the trouble machine.
Can this machine connect to another sql server provided with similar access?
Execute select * from mysql.user ; and check you don’t have duplicates with
different access privileges or passwords .
turns out i had everything setup correctly, as i said i was able to use the same user across other servers just not this one.
turns out my server provider had a network firewall restricting mysql connections. removed and hey presto.
thanks #csf

Can't connect to database

Actually I'm having more than one problem...but all of it has to do with connecting or working with the MySQL database...First you can see one of the errors on my website and no matter what you choose it seems to just say it can't connect to the database...I've configured a configure.php file to allow files to connect to the MySQL database...see the website here:
http://netsurfer123.byethost11.com/index.php
Then when I try to log-in to the Admin area of my MySQL database it just says:
phpMyAdmin - Error
Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly.
Please let me know what I can do to correct these errors...and thanks very much in advanced for any helpful response/s.
First you need to check if the MySQL server is actually running. Use a command such as
/etc/rc.d/init.d/mysqld status
Or similar for your system if possible.
Did you check the web server log file? Does it contain errors as indicated by phpMyAdmin?
Your site is simply unable to connect to the database to which it's trying to connect. This could be for any number of potential reasons:
Is the database running?
Is the database accessible by that machine? (Maybe there's a firewall in between the two servers, if they're separated?)
If the database is on that same machine, are you connecting to it properly? (Maybe it allows only certain connection methods, such as a socket vs. the loopback address?)
Is your connection string correct? Maybe the login is failing?
Check your PHP logs, your Apache logs, your MySQL logs. One of them is complaining about something and it's probably trying to tell you what.

MySQL error "No Database Selected"

I am using LAMP on localhost. I can login which uses mysql db, get to the main page (data driven), but when i enter this particular page, its fine, but when i refresh the error is "No Database Selected" then one every page says so.
I restarted the Apache, MySQL server
Browsers FF,IE, Chrome all show the same errors, cleared cache too. At the same time other websites that use the same LAMP server works fine.
Now thats strange
All ideas are welcome.
Are the main pages using mysql_select_db("foo") and this particular one not?
When you are connecting with php, you are not selecting a database (or the select is failing). Is it perhaps using a variable which is not getting properly populated?
Somewhere in the code (PHP) the default database gets reset, probably on a shared database connection. I guess this is a bug in the product you use.
Try going through the code where it connects with database and tries to pull the data. Most of the times there is a configuration file which defines the connection attributes like username, password, database server, port and database to be used also.
for example in phpMyAdmin keeps the information in libraries/Config.class.php file.