After Magento server move I get SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known - magento-1.9

Please can someone help, I am tearing out what little hair I have left.
I had to move a clients Magento from one 1and1 server to another and I am getting the above error message when trying to access the site. Whilst 1and1 server support has tried to be helpful their Magento knowledge is limited and I am not getting very far.
Initially I was told to just upload the Magento files and database onto the new server after which I was getting the above error report. After three days of trying to get help at 1and1 someone said that I should have installed Magento first through Plesk and then uploaded the files. I duly did this and prior to uploading the original files Magento was actually working with the basic installation page and I could get access to Admin but after uploading the files and the database I am back to the square one.
I have checked over and over again the local.xml with the settings in Plesk and as far as I can see the database settings are correct.
The database can be seen in ssh command line. I have restarted the server.

In your env.php under the 'db' section, the value of the host,dbname, username, and password should be set properly. If your facing this issue at your local with the host then set 'host' => 'localhost', or 'host' => '127.0.0.1'

Related

How do I connect a to a mysql database hosted on pythonanywhere?

I have bought a basic 6$ pythonanywhere server which allows for SCP and SSH connections to their servers. I have deployed my flask application (REST API) to the server and set up a local environment (installed packages, set up path and environmental variables). I ran the app, and it gives me the 404 page on the / route which is actually a sign that it is working.
However when I try to hit a route like /api/users/3 for example, it gives me an error 500 (internal server error). I dug around some log files on the server and found one which is basically the output of the WSGI web server which is host to my flask application. It said that there is an issue with the database communication. From what I understand, it connected successfully but it couldn't query the data from the table:
(1044, "Access denied for user 'secret_username'#'%' to database 'test'")
I have tried to fix this through the web mysql console by giving my <secret_username>#secret_username.pythonanywhere.com all the privilages to test.*, but it gives me an access error once again. I tried to SSH into the machine that is host to the mysql server and tried to connect to it - secret_username.mysql.pythonanywhere-services.com but it doesn't allow me to ssh into this server.
Has anyone experienced this issue? I am almost sure that my connection is set up correctly because if it didn't establish connection it would give me an access error with message `using password "yes". I've read on forums a bit, they suggest installing a mysql server on the same server as the flask application, but I don't have access to sude for some reason, probably due to my cheap plan. Any ideas?
If you are using the MySQL database provided by PythonAnywhere, with the hostname secret_username.mysql.pythonanywhere-services.com, then your database will be called secret_username$test, not just test -- see the "Databases" page on the PythonAnywhere website.

Why can't I set up my Kalabox Drupal Site? SQLState[Hy000] error

I have a fresh install of Ubuntu 14.04 in Hyper-V, a fresh install of mysql and user 'root'#'localhost' with 'password'. I created a database called 'drupaltest'. Yet when I start up a kalabox Drupal Site, I try enter that information in and I get this error:
Failed to connect to your database server. The server reports the following message: SQLSTATE[HY000] [2002] No such file or directory.
Can you help me figure out what's going on with it?
You can find the related information to your question here. From this you find your database related information following these steps:
Use the Terminal option from the dropdown to access the location of the PHP app that you already created. In this example it is the second option for the existing new Drupal 8 installation.
This will open the terminal navigated to the kalabox container. confirm that it is in the parent directory. Check for the kalabox root files and directories; cli.yml, code, config, dockerfiles, etc.. They should resemble something like this:
You can see that the kalabox container is located in my user directory.
use the kbox services command to print the services available to the container. If it doesn't work you may not be in the parent directory of the container and would refer back to step 2.
use the mysql database that comes with your kalabox site!

Unable to connect to your database server using the provided settings

I am usign codeigniter and I have hosted my web site on free hosting and everything was fine until an error occurred. The error is
Unable to connect to your database server using the provided settings.
Filename: core/Loader.php
Line Number: 346
But if I refresh the page the error is gone, but sometimes comes again and I don't why.
I have checked the forum for other errors like this and I have found that first I need to debug to understand what the error is.
It shows
Connecting to database: database_name
Connected OK:file: /home/vol11_6/byethost7.com/database_name/htdocs/application/config/database.php Line: 81
Other users say that the error comes from php.ini or mysql.default_socket was pointing to file in a non-existent directory.
My question is how am I supposed to find this php.ini or the directory like /var/lib/mysql/mysql.sock
on the free hosting. I can't find none of them.
Sorry if something was unclear.
Thank you in advance.

CakePHP, NearlyFreeSpeech.net, and MySQL

In the last ~week, my CakePHP site has been unable to connect to a MySQL database. Everything is hosted by NearlyFreeSpeech.net and I don't see any problems with the financial aspects of my account.
Does anyone know what's going on?
I'm able to connect to the database with phpMyAdmin and my automated mysqldump calls have worked fine, so I didn't find out right away.
I tried putting up a new CakePHP site using a fresh download from CakePHP but I get the same error message:
Warning (2): PDO::__construct() [pdo.--construct]: [2002] Operation timed out (trying to connect via tcp://cakeht.db:3306) [CORE/Cake/Model/Datasource/Database/Mysql.php, line 177]
Cake is NOT able to connect to the database.
Database connection "Mysql" is missing, or could not be created.
SQLSTATE[HY000] [2002] Operation timed out
Does anyone have any advice?
The problem was magically fixed with the passage of time.
The solution then, is to simply wait an unknown number of days.

Connecting Funambol to MySQL on remote host

I am setting up Funambol 8.7 on a Linux host (using Amazon AWS). I need to connect to a MySQL datbase that is hosted on a different server.
Per the administration guide I went ahead and downloaded the mysql connector and placed the jar in /opt/Funambol/tools/jre-1.6.0/lib/ext. I changed the install.properties file as follows:
dbms=mysql
jdbc.classpath=/opt/Funambol/tools/jre-1.6.0/jre/lib/ext/mysql-connector-java-5.1.14-bin.jar
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://myserver.net/rugcutte_funambol?characterEncoding=UTF-8
jdbc.user=rugcutte_funambo
jdbc.password=funambol
THen I try to run the install, but get the following error:
/opt/Funambol/ds-server/install/install.xml:452: java.sql.SQLException: Access denied for user 'rugcutte_funambo'#'ec2-50-16-233-200.compute-1.amazonaws.com' (using password: YES)
It appears my AWS instance can connect successfully to my MySQL database however it is trying to login with a fully qualified user name that is incorrect: rugcutte_funambo'#'ec2-50-16-233-200.compute-1.amazonaws.com
I tried also to change the line to : jdbc.user=rugcutte_funambo#myserver.net . But I got a similar error with that as well.
I am relatively inexperienced to JDBC. What is the proper way to set up this section of the install.properties file?
Did you enable access to that database with that user from that server?
What happens if you try and just make the same mysql connection from the command line from your Funambol server?
Thanks Adam.
You led me to the correct answer. The remote host has an area in cPanel to configure Remote Database Access Hosts. So I did, need to add my source host that is running Funambol, to my list of access hosts.
After this I ran the install and it did, appear to create the tables properly in the database running on my remote host.