PDA

View Full Version : cant connect to database



Girl.Geek.Nascent
02-18-2005, 01:46 PM
hello,

I am trying to install ZenCart and I am stuck in the installer at the database setup screen because it is telling me it cant connect to the database

i have gone into phpmyadmin and created a new database and a new user for the database and set user to all privileges. i have changed the password a couple times and even tried creating a couple more users to see if any of them connect, but it wont. i am using 'localhost' as the host.

can anyone think of anything else i should check to see what my problem is? thanks!

jalal
02-18-2005, 02:25 PM
"flush privileges" ?

8)

sunzon
02-18-2005, 03:14 PM
I don't know zenkart (is it in perl?)

Have you installed perlsql 1.1 (needed for perl to work with mysql)?
Its in sitemanager.

Click on "permysqltest", does it give you an ok?

Do you have any other database installed already (like for phpbb)?

Girl.Geek.Nascent
02-18-2005, 03:18 PM
it's php ( http://www.zencart.com )

this is the first database i have made and i havent installed anything like phpbb through the site manager.

going now to figure out how to flush the privileges. thanks for the help

sunzon
02-18-2005, 03:32 PM
I assume zencart sets up the tables for you in the database, you just need to create one, is that right?

If so, I can give you the (simple) instructions on what to do via SSH to create the database, if you are comfortable with that.

sunzon
02-18-2005, 03:44 PM
Here's how to create a database via SSH (eg using PUTTY)

Once logged in:
Assuming you want to name your database "geek"


1>Let's first remove your previous attempt in case it's there:
$ mysqladmin -u root -p drop geek
you will be asked the password, then click enter.

2>Now we will create a database (change to "geek2" if you like):
$ mysqladmin -u root -p create geek
you will be asked the password, then click enter.

that's it.
So now back to your zencart installation:
host name = localhost
database name = geek
user = root
password = whatever

hth

Girl.Geek.Nascent
02-18-2005, 04:24 PM
i created the database in phpmyadmin . i dont know anything about SSH or PUTTY. thank you for trying, i really appreciate it

wildjokerdesign
02-18-2005, 05:41 PM
Where you able to find flush privileges? Should be a link at the bottom of the priviledges page in phpMyAdmin.

Girl.Geek.Nascent
02-20-2005, 08:00 AM
yeah, i tried that, it didnt work, and then i tried starting over with a new database and new user and still says cant connect to the database. guess i'm stuck with Miva until I get some php/mysql skills. Thanks for trying to help.

:cry: :cry: :cry:

jalal
02-20-2005, 09:37 AM
i have gone into phpmyadmin and created a new database and a new user for the database and set user to all privileges. i have changed the password a couple times and even tried creating a couple more users to see if any of them connect, but it wont. i am using 'localhost' as the host.

When you say you created a new user, you mean that you went into the mysql database and added a line to the users table? Right?
In the 'user' table is a line like:
localhost myuser es9w0e0ws0cc00a Y Y etc...

Did you also add the database into the db table and link that to the user? You will need to do this I think. In the 'db' table will be a line like:

% zencart myuser Y Y etc....

Maybe you have already done all that, just thought I would check.

Girl.Geek.Nascent
02-20-2005, 11:31 AM
oooooh! oh my! see, I am Cpanel spoiled so I never had to go and add users to an actual database table, just created the database and users and it was done and i was on my way.

I did however, after reading this, as a last resort, tried using the already established root user and it worked. so apparently i am usermaker impaired and need to go read the mysql site.


thanks.

wildjokerdesign
02-20-2005, 11:41 AM
Well that is good news since it means that the script is at least now set up right. You should now be able to figure out the new user and setting it so it can access the database. I have done it via phpMyAdmin in the past when I wanted a certian user to have access to just one database. When you first set up the user you do not give it any privledges. Then once created you can view the privlidges for that user and add them per database. It is in a drop down about midway down the page.

Log into phpMyAdmin. Then click on Priveliges. You should see all your users listed. Then click on the edit link for the user that you want to modify the privliges for. I am on the new version of phpMyAdmin and it is an Icon. I think the old one was a text link. Now under Database-specific privileges you should see the drop down. Select the database you want to add privleges for right away you are taken to a new screen and at the top should say somehting like User 'theusername'@'loacalhost' - Database thedatabasename. Now select the privliges you want and hit the first Go button. That user now has those privliges for that database and you should be able to use them in your setup to connect to that database.

HTH