• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Cannot connect to the MySQL database

V

voltaq

Guest
I have an php-script that connects to a MySQL database.
But I get the following error:
[Host 'localhost.localdomain' is not allowed to connect to this MySQL server]
I think it's because 'localhost.localdomain' isn't included in the "allowed hosts" of MySQL.
My question is: How can I add 'localhost.localdomain' to the "allowed hosts" of MySQL?

Thanks in advance.
Edit/Delete Message
 
Similar

I am also having problems using a groupware tool that uses PHP and MySQL. Have you done any updates lately?
 
Hi,
My problem is also with a groupware application.
Yesterday was my last update.
Wich groupware are you using?
 
I am using eGroupware. I have been using it for a couple of years and this is the first time I have had anything like this happen. Based on all the threads I have been reading it appears that the problem started with a new version of PHP (4.3.10) that is conflicting with IonCube and/or Zend Optimizer. The reason I am not being specific is because no one seems to be able to definitively say what the problem is and how it can be resolved. I am not being naive and realize that there are hundreds of different server environments that will no doubt respond to different solutions but I am surprised at how stark the contrast is in suggestions. Its one thing to say install this version instead of that version but in this case some people are saying install and others are saying uninstall. This goes for both the IonCube and Zend Optimizer packages. Hopefully I can get to the bottom of this and I will post the full details of my findings since many of the suggestions to date are sorely lacking in detail.
 
I'm also using eGW and get this problem when I add an extra domain. Specificly when I want to create a databasse for that domain.
I was thinking in editing the connect method that the eGW(phpgwAPI) is using.
Maybe you had tried this before?

Greetings, Renato
 
I think at this point I should request that we clarify what each of our respective problems is. In my case I had working installations of eGroupware and after I upgraded my system (YUM) I found that my eGroupware installations weren’t working, my Horde webmail was being displayed in Arabic and would not allow users to log in. After several hours and much frustration I found that PHP had been upgraded (4.3.10) and this conflicted with IonCube. I fixed this by going to the ‘/etc/php.d’ directory and edited a file called ‘ioncube.ini’ by commenting out the following line -

;zend_extension=/usr/lib/php4/ioncube_loader_lin_4.3.so

I restarted Apache (#service httpd restart) and everything is now working as I expect it to. If any of this sounds similar then the information may be of use otherwise you will need to explain your situation in a little more detail.
 
Hello,
I'm using Plesk 7.5.2 and my eGroupware installations is working good.
I encounter problems when I try to create a database for a new eGW-domain.
-First I go to the [Header Admin] to create a new eGW-domain.
-After that I go to the [Setup/Config Admin] to create a new database for the chosen eGW-domain.
-After this I should have a database with tables for every eGW application. But I get the following errors:
Code:
Database error: ADOdb::PConnect(127.0.0.1:3306, stp_gr1_usr, $Password, mysql) failed.
mysql Error: 1130 (Host 'localhost.localdomain' is not allowed to connect to this MySQL server)

Function: db::query / db::create_database

Database error: ADOdb::PConnect(127.0.0.1:3306, stp_gr1_usr, $Password, stp_gr1_db) failed.
mysql Error: 1130 (Host 'localhost.localdomain' is not allowed to connect to this MySQL server)

Function: db::create_database

I went to /etc/php.d but did not found ioncube.ini instead I found ;zend_extension=/usr/lib/php4/ioncube_loader_lin_4.3.so in /etc/php.ini
I commented it, restarted Apache, but it did not solve my problem.

I hope you can help me solving this problem.

Gr, Renato
 
Don’t use the eGroupware environment to create your database. Use the Plesk control panel to create the MySQL database for the domain you are going to be using eGroupware in. After you have created the MySQL database in the Plesk control panel then use the eGroupware setup and enter the username and password that you created in the Plesk control panel for the MySQL database that eGroupware is going to use.

I haven’t tried it but you might be able to use eGroupware to create the database. When Plesk is installed it locks root access to MySQL and instead creates an ‘admin’ account that uses the same password as what you use to log into the Plesk control panel as ‘admin’. I don’t recommend using this option and consider the first option more secure and has the added benefit of managing databases by domain.

Regarding the ‘zend_extension’ issue it sounds like your configuration is a little different. I think in your situation you may have to upgrade your version Zend Optimizer to 2.5.7 (http://zend.com/). I can’t be sure about this as my experience has been different.
 
The database has been created with Plesk.
What eGw does is: login into the database and create the needed tables for the eGW-applications or eGW-domain.
When eGW wants to create those tables I get these errors.
Do I have to add something like:
<Alow localhost.localdomain to the MySQL server>, if that does exsist?
 
It sounds like you have done everything the same way I did although I did not have any problems which leaves me thinking that you either entered the incorrect information into one of the eGroupware fields or you are not using the same database account for eGroupware that you created in Plesk. The errors you are getting are (at the risk of stating the obvious) permission errors that will only happen if you don't provide the correct credentials.
 
Finaly :: Problem solved!

All the credentials where correct.
I must say that I started praying.:)
The problem was the "DB host" field in the [Header Admin].
I had "127.0.0.1" filled all the time. I changed it to "localhost" and that did the trick.

Thanks alot for your help/posts.

Grz, Renato
 
Good to hear

Great to hear that you’ve solved the problem. I had a look at my configuration and I have 'localhost' entered although I don't see why '127.0.0.1' shouldn't work since it basically means the same thing. Just out of curiosity I am going to experiment. I can only think it might have something to do with your routing config. If I find anything useful I will post it. Have fun.
 
Back
Top