stuck at step 5 - getting database related errors

MaLuBoB

Joined: 2004-10-14
Posts: 3
Posted: Thu, 2004-10-14 01:06

Hello,

If anyone could help me out, I'd appreciate it. I'm stuck at this step.

I am running my own server with Gentoo. I'm learning Linux as as I go. I keep getting this error when I'm at step 5.

We received the following database related errors:

Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2) in /var/www/localhost/htdocs/gallery2/lib/adodb/drivers/adodb-mysql.inc.php on line 338
localhost: Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)

Does anyone have any ideas about what I'm doing wrong.

I had to type in this to create the database.
mysqladmin -uroot - p create gallery2
then put in my password to get this done else it wouldn't let me

then from the readme i did:

mysql gallery2 -uroot -e"GRANT ALL ON gallery2.* TO username@localhost IDENTIFIED BY 'password'"

i placed any username and password, i put my username and password. Is this ok?

I don't know what else to try. I can't get past this step. Is there any advice anyone can give me so I can get this working?

Thanks

Bobby

 
homer123

Joined: 2004-10-13
Posts: 15
Posted: Thu, 2004-10-14 12:30

I think you need to redo the line

mysql gallery2 -uroot -e"GRANT ALL ON gallery2.* TO username@localhost IDENTIFIED BY 'password'"

with

mysql gallery2 -uroot -p -e"GRANT ALL ON gallery2.* TO username@localhost IDENTIFIED BY 'password'"

Note the extra -p.

The username and password is the username and password that you use for your mysql installation db and not an arbitrary username and password

 
MaLuBoB

Joined: 2004-10-14
Posts: 3
Posted: Thu, 2004-10-14 18:59

I tried that I put in the -p to enter my root password.

I also put in my own username and password, I didn't write it in in the post.

 
baschny
baschny's picture

Joined: 2003-01-04
Posts: 328
Posted: Fri, 2004-10-15 12:41

MaLuBoB, the error you encountered has nothing to do with the permissions, but with the mysql-client being unable to connect to the mysql-server. Does your MySQL server generates a file called /var/run/mysql/mysql.sock ? Maybe it is really /tmp/mysql.sock? If this is the case, try making a symbolic link:

ln -s /tmp/mysql.sock /var/run/mysql/mysql.sock

This problem comes when you compile mysql and php with different mysql-client configurations. Maybe you might consider recompiling them? Or seeing where you've got the packages from, and see if you can get them from a single source?

If nothing works, try changing "localhost" as a database-server to the real hostname of the machine (or the IP), so that it connects using TCP/IP instead of unix-sockets, so it won't matter where this file is located.

 
MaLuBoB

Joined: 2004-10-14
Posts: 3
Posted: Fri, 2004-10-15 15:09

baschny,

I tried what you suggested, I don't have that mysql.sock file in either of those locations so I tried searching for the file using
fine / -name mysql.sock

and it didn't find anything.

I'm new to linux so I'm unsure of what you meant by "This problem comes when you compile mysql and php with different mysql-client configurations."

I also tried changing the hostname to my ip address itself and the first error went away and another error came up.

Warning: mysql_connect(): Lost connection to MySQL server during query in /var/www/localhost/htdocs/gallery2/lib/adodb/drivers/adodb-mysql.inc.php on line 338
192.168.11.2: Lost connection to MySQL server during query

when putting in the database username and password, is this a user I create as a unix user or do I create a separate user in mysql? If so how do I go about doing that?

Thanks for the help.

Bobby

 
baschny
baschny's picture

Joined: 2003-01-04
Posts: 328
Posted: Fri, 2004-10-15 15:28

MaLuBoB, my guess is that mysql isn't running, that's why you can't connect to it. You should read through mysql documentation. Without knowing specifics about your setup (linux distribution, version, etc) its difficult to know what is happening. You could try a few things:

Start mysql (e.g. with /etc/init.d/mysql start or something similar).

Check if it doesn't work now (with the "localhost" back).

The username/password in MySQL are maintained just in mysql and have nothing to do with unix user/password.

 
mxreb0

Joined: 2006-08-03
Posts: 9
Posted: Thu, 2006-08-03 16:41

You need to install mysql-server you may just have mysql installed.

 
eyaal
eyaal's picture

Joined: 2008-10-09
Posts: 1
Posted: Mon, 2008-10-13 18:27

Hi guy,
I am having similar challenge, for almost two weeks been trying to setup mysql database(step5) but kept having this error message:Warning: mysqli_real_connect() [function.mysqli-real-connect]: (00000/1129): Host 'host206.hostmonster.com' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' in /home/gennesar/public_html/egsalumni/main/modules/gallery/gallery2/lib/adodb/drivers/adodb-mysqli.inc.php on line 108
Could't connect :
gennesaretitsolutions.com: Connection error to server 'gennesaretitsolutions.com' with user 'egsadmi'
what could posibly be the challenge?

I will be very gratefful if someone can help me.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Mon, 2008-10-13 19:04
Quote:
Host 'host206.hostmonster.com' is blocked because of many connection errors;

You're going to have to contact your host to see what sort of limitations they have set in place that you might be bumping against.

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here