1
anhDP
Could not connect to the database serve
  • 2008/2/25 21:48

  • anhDP

  • Just popping in

  • Posts: 16

  • Since: 2007/5/17


Hi All,
I am installing XOOPS 2.0.18 to a Mac server. I am using PHP 4.4.4, MySQL 5.0.27. Everything is fine until the database connection during the install. I used the same info to login using the client and it works fine. I cannot find any error logs to tell me why. I have nothing to show and no leads at the moment, what should I do to generate the errors in the a log file somewhere?

Thanks,
Doug

2
dbman
Re: Could not connect to the database serve
  • 2008/2/26 3:29

  • dbman

  • Friend of XOOPS

  • Posts: 172

  • Since: 2005/4/28


assuming it's your own server...

Did you try creating a new user already?
If not login to MySQL from terminal as the MySQL root user. Run:
grant all privileges on xoops_database.* to 'dbuser'@'localhost' identified by 'dbpassword';

flush privileges;

Try your install again using the credentials you just created.

3
bikingman82
Re: Could not connect to the database serve
  • 2008/5/13 18:12

  • bikingman82

  • Just popping in

  • Posts: 8

  • Since: 2008/5/13


I have this exact same problem. I also am on a mac using MySQL 5.0.51b. I have the permission set for the database and flushed but I still get a red light at Check Database. Saying could not connect to the database server.

4
Catzwolf
Re: Could not connect to the database serve
  • 2008/5/13 19:56

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


Do you know if previous version of XOOPS works with the server?

5
bikingman82
Re: Could not connect to the database serve
  • 2008/5/13 20:04

  • bikingman82

  • Just popping in

  • Posts: 8

  • Since: 2008/5/13


ok I found the fix if you are getting this error.

I had to go and enable MySQL in the php.ini file.

navigate to the php.ini.default file by typing cd /etc.

In its current state, php.ini.default does nothing; php launches with its default values. In order for php to read the ini file, it must be renamed to php.ini. We will do a copy to retain the default file, just in case:

sudo cp php.ini.default php.ini

sudo pico php.ini. Press Control-W and search for mysql.default_socket, and make it look like this:
mysql.default_socket = /tmp/mysql.sock
Save the changes by pressing hen pressing Control-X, then press Y, then press Enter.

Doing this fixed the issue.

6
Catzwolf
Re: Could not connect to the database serve
  • 2008/5/13 20:07

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


Thanks for posting a fix and helping other mac users :)

7
Anonymous
Re: Could not connect to the database serve
  • 2008/5/13 20:11

  • Anonymous

  • Posts: 0

  • Since:


Recently many websites have this problem, and I don't know if this happened after upgrade to 2.0.18.1 or after cpanel upgrade.

Quote:
This page cannot be displayed due to an internal error.

If you are the administrator of this site, please visit the XOOPS Troubleshooting Page for assistance.

Helpful infomation you should provide while asking for assistance:

Error [Xoops]: Unable to connect to database in file class/database/databasefactory.php line 34

8
goodwill1120
Re: Could not connect to the database serve

Tried the php.ini hack with no luck here even after restarting apache.

My default socket is at /opt/local/var/run/mysql5/mysqld.sock, and I have customized this into the php.ini mysql.default_socket, anything I have missed?

9
goodwill1120
Re: Could not connect to the database serve

To add some info: I have checked both MySQL and mysqli default socket are changed, and I can connect with a simple PHP saying:
mysql_connect("localhost","user", "pass") without any problem. Something gone wrong?

10
goodwill1120
Re: Could not connect to the database serve

Forget it... I am just stupid... I test with root and then actually its my xoop specific account failing :)

Login

Who's Online

205 user(s) are online (142 user(s) are browsing Support Forums)


Members: 0


Guests: 205


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits