stuck at step 5 - getting database related errors
MaLuBoB
Joined: 2004-10-14
Posts: 3 |
![]() |
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 Does anyone have any ideas about what I'm doing wrong. I had to type in this to create the database. 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 |
![]() |
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 |
![]() |
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
![]()
Joined: 2003-01-04
Posts: 328 |
![]() |
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 |
![]() |
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 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 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
![]()
Joined: 2003-01-04
Posts: 328 |
![]() |
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 |
![]() |
You need to install mysql-server you may just have mysql installed. |
|
eyaal
![]()
Joined: 2008-10-09
Posts: 1 |
![]() |
Hi guy, I will be very gratefful if someone can help me. |
|
nivekiam
![]()
Joined: 2002-12-10
Posts: 16504 |
![]() |
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. ____________________________________________ |
|