1
Eskimo-mo
can't connect to server - what's going on?
  • 2008/3/30 11:06

  • Eskimo-mo

  • Just popping in

  • Posts: 22

  • Since: 2008/3/12


Having switched to a dedicated server I'm having problems connecting to it. Can anyone help me figure out what's going on??

Three times in a week my website has gone down.

When it does it says 'Cannot find server' 'db connection failed'.

I can still open any static html pages (outside xoops) and I can connect to FTP and I can even connect to the server as 'root' using Putty.

But if i try to connect to the XOOPS site or phpmyadmin it can't connect to the database.

Each time the server host say the only thing they can do is to reset the server - they do it and the problem is fixed but it seems the problem is only fixed for a few days.

I'm guessing that it is to do with my MySQL but how can I check that?

Does anyone have any idea of what's going on?

Thanks so much

2
onasre
Re: can't connect to server - what's going on?
  • 2008/3/30 22:17

  • onasre

  • Not too shy to talk

  • Posts: 150

  • Since: 2006/8/12


i have the exact problem and i the only way to fix it like you said to reset the server or create new database and import the old on .. i dont know if this XOOPS problem or Hosting problem , I'm with Servage are you with servage too ? i keep ask them aboutt he problem and they said to create new database bla bla bla ...
Whatever Hits You , Never was to Mess you , and Whatever Messed U , Never Was to Hit You.

3
dbman
Re: can't connect to server - what's going on?
  • 2008/3/31 0:36

  • dbman

  • Friend of XOOPS

  • Posts: 172

  • Since: 2005/4/28


Try creating a new MySQL user and giving privileges on the XOOPS database to that user. Once the new user and privileges are created update your mainfile.php to reflect the new database user credentials.

4
Eskimo-mo
Re: can't connect to server - what's going on?
  • 2008/3/31 6:47

  • Eskimo-mo

  • Just popping in

  • Posts: 22

  • Since: 2008/3/12


Thanks a lot dbman!

I've not set up a new user before so can you tell me if this is the right way to go? (using phpmyadmin)

Here are the users my server host has set up. My XOOPS tables are all in a database called njud2008_db.

User      Host     Password  Global privileges    Grant 
Any        
%          No          USAGE            No  
Any      localhost    No          USAGE            No 
njud2008   
%          --          USAGE            No 
njud2008   
%          Yes         USAGE            No  
root       
%          Yes       ALL PRIVILEGES     Yes 
root     localhost    Yes       ALL PRIVILEGES     Yes


So am I right in thinking that I need to edit the user 'njud2008' to have all privileges for 'the wildcard name (username\_%)'. And also that user: njud2008 should be set-up as both Any host (%) as well as local host.

Is that the way to do it? Sorry but want to make sure before i try it for the first time !!! By the way, what's the user called Any (no password) for?

Thanks again!

Hey onasre, its always good to know that I'm not the only one with the problem. I'm not with servage so I guess its not really their fault - just one of those things.

5
irmtfan
Re: can't connect to server - what's going on?
  • 2008/3/31 8:28

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


it seems you MySQL server get down in those times.
you should check these:
1- check the server load to find if it is too high
2- repair the MySQL database (you can use xoopscare module)
3- check the number of connections to your database that one database user allowed
4- check if an script or module act improperly. ask your hosting provider to find the problem

6
Eskimo-mo
Re: can't connect to server - what's going on?
  • 2008/4/1 7:47

  • Eskimo-mo

  • Just popping in

  • Posts: 22

  • Since: 2008/3/12


Thanks irmtfan but my server host won't help at all - they say that as its a dedicated server the problem is mine to fix.

I have been optimizing regularly and as its a dedicated server there is no max No of connections per user.

Am i right in they way to set up a new 'non-root' user?

7
Bablorub
Re: can't connect to server - what's going on?
  • 2008/4/1 8:26

  • Bablorub

  • Just popping in

  • Posts: 3

  • Since: 2008/4/1 8


He-he.. got the same thang dude, now it's up to us to solve it, buck 'em! ;)

8
avtx30
Re: can't connect to server - what's going on?
  • 2008/4/1 9:07

  • avtx30

  • Not too shy to talk

  • Posts: 181

  • Since: 2006/10/12


What is your server OS? If it's Linux box then what's the distribution? I meant Redhat, or FreeBSD, or others. Can you access to your server via SSH? Do you have MySQL skill to create databases and grant privileges to them?
Xoops Demos:
http://www.nhatban.net/info/a0021.html

9
Eskimo-mo
Re: can't connect to server - what's going on?
  • 2008/4/1 10:25

  • Eskimo-mo

  • Just popping in

  • Posts: 22

  • Since: 2008/3/12


Hi avtx30, the server is Unix and yep, I've got root access to it (i use putty).

I've not created databases with privilleges before but I reckon I can see how to do it with phpMyAdmin. What do you suggest?

Bablorub - how do you stay so positive?????

10
dbman
Re: can't connect to server - what's going on?
  • 2008/4/1 19:58

  • dbman

  • Friend of XOOPS

  • Posts: 172

  • Since: 2005/4/28


If you have ssh access (putty) you can create the MySQL user and privileges from there.

I assume you have the MySQL root password as well.

Once you have successfully connected via putty run this command to login as MySQL root:

mysql -uroot -p


You will prompted for a password, enter the MySQL root password to continue.

You mention the XOOPS database is already loaded so you only need to create a user and grant privileges:

grant all privileges on xoops_database.* to 'dbuser'@'localhost' identified by 'dbpass';


Substitute xoops_database, dbuser and dbpass with your own credentials.

Once complete, flush the user privileges:

flush privileges;


You should be able to login to MySQL now using:

mysql -udbuser -pdbpass


and view the XOOPS database using:

show databases;


Edit your mainfile.php with the newly created user info and your XOOPS install should now be able to connect to the database.

Login

Who's Online

184 user(s) are online (114 user(s) are browsing Support Forums)


Members: 0


Guests: 184


more...

Donat-O-Meter

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

Latest GitHub Commits