hello Drupal community,
this is my very first post, am trying to install Drupal on my mac machine (i.e., locally, not on a web server..) have later than minimum required versions of Apache, PHP, & MySQL..
of course am running into probs with db... oh brother.. db always a problem.... I should have known....;-)
first, a comment: I think something is not too clear: when it asks for uid/pswd for db it's not clear whether you're supposed to create new uid/pswd for the particular drupal db, or are you supposed to type in uid/pswd you have already for MySQL server? (people often say "db uid/pswd", when in fact it's uid/pswd to conn. to the server, not to a particular db... correct me if I'm wrong.. at any rate b/c of the questions below figured out it's uid/pswd for the server...) maybe instr should just ask for uid/pswd you use to conn. to the server.. I think that would be a bit clearer...
after entering db info, am getting this msg:
Failed to connect to your database server. The server reports the following message: SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES).
Is the database server running? -- of course, I just created the db for drupal ;-)
Does the database exist, and have you entered the correct database name? -- yes
Have you entered the correct username and password? -- yes, more than once (root & pswd, which I use to conn. to MySQL server..)
Have you entered the correct database hostname? -- yes (& logged out and in of MySQL server, my newly-created db for Drupal is there...)
(one note on hostname: for some reason, to conn. to MySQL from PHP have to put '127.0.0.1' instead of 'localhost'; I don't know why (from JSP 'localhost' works fine..))
so I tried both 127.0.0.1 and localhost, neither one works.. (but am assuming the correct one is 127.0.0.1, since get less errors when use this one instead of 'localhost'...;-)
if the port is 3306, do I have to put it in? I tried with and without filling that in...
where do I go from here??
Tried everything numerous times before posting this.... I'm not a newbie when it comes to local servers, have been using MySQL on local machine for years, have installed & configured Tomcat on numerous machines (windows & mac); (PHP env came installed with my mac...;-)
there must be something in MySQL stuff I'm still missing.. can't figure out what it is... :-(
would very much appreciate help/suggestions...
thank you...
Comments
One solution is to install
One solution is to install Acquia dev desktop.
These problems can get tricky. When you say 'logged in and out of mysql server' I assume you mean via command line? Anyway provided your username + password pair are correct and are allowing you to access the database by other means (e.g. phpmyadmin or command line), you might also need to check that the relevant user has been granted all privileges (or at least all privileges required by Drupal) on the database in question. Just a guess but I know this is easy to overlook.
You do not really need a db password on a local machine if security is not an issue, of course. But user must still have correct privileges on the database.
Digit Professionals
One solution is to install
One solution is to install Acquia dev desktop.
These problems can get tricky. When you say 'logged in and out of mysql server' I assume you mean via command line? Anyway provided your username + password pair are correct and are allowing you to access the database by other means (e.g. phpmyadmin or command line), you might also need to check that the relevant user has been granted all privileges (or at least all privileges required by Drupal) on the database in question. Just a guess but I know this is easy to overlook.
You do not really need a db password on a local machine if security is not an issue, of course. But user must still have correct privileges on the database.
Digit Professionals
Acquia dev desktop??what is
Acquia dev desktop??
what is this?
why can't I make MySQL aspect of this work? the way it's supposed to work?? (unless I missed something in instructions??)
like I said, db always a prob... :-(
thank you...
For Acquia dev you only have
For Acquia dev you only have to google, I just did it https://www.acquia.com/products-services/dev-desktop
you do not say whether you added privileges. I cannot think of anything else, provided you can connect to the database via command line with the same credentials you are using for Drupal.
Digit Professionals
thank you for your response..
thank you for your response.. I did not see anything about adding privileges in the install process... what do you mean, exactly? privileges for MySQL?
(can these fora be set up so you get email notifications when you get a response?)
thank you...
PS: still don't get why need this extra Acquia thing? (and might have same MySQL probs when installing/setting up that one..) so would I need to do this in lieu of the present Drupal install I have, or in addition to it?
actually that Acquia thing
actually that Acquia thing installs Apache, MySQL..
I already have those installed... (and MySQL has to work with my JSP environment too.. years ago, on a windows machine, I installed a thing called XAMP, I think, that also installed MySQL, which I already had installed, it messed everything up.. was never again able to connect to MySQL from Tomcat/JSP...)
don't want to re-invent the wheel... have a very good set-up now.. (Apache/PHP that came installed in my mac, Tomcat for JSP that I installed myself, and MySQL that I also installed myself, and that I can connect to from both JSP and from PHP; I'm afraid this Acquia thing might "unsettle" my whole set up.... ;-)
thank you....
There is more than one
There is more than one install page from the documentation (see link at top of this page). If you find one which does not mention adding privileges for the user on the database, please post the link and I will edit it to correct it. All of the installation instructions from the Documentation tab above should work, though some are more suited for beginners, others for experienced users.
Digit Professionals
I don't quite get the
I don't quite get the "privileges" issue for MySQL..
I already have privileges, created db (had created a no. of db's before also..)
this is on my local mac machine, not on a web server...
I need special MySQL "privileges" for use with Drupal that I don't otherwise need??
thank you..
You say "I" have the
You say "I" have the privileges. More to the point is whether the db user whose db username you enter in Drupal during the installation process has the privileges required on the database. If it is the root mysql user (not the same as the root user of your computer or server!) it should have sufficient privileges by default, as you suggest.
Anyway it might be worth double-checking the privileges attaching to the db username you are using, on the database in question. Quite how you check depends on whether you prefer to manage the database form command line or a gui like phpmyadmin. The latter has a privileges tab, I seem to recall.
Digit Professionals
"More to the point is whether
"More to the point is whether the db user whose db username you enter in Drupal during the installation process has the privileges required on the database..."
well of course it does, I can create db's and make queries and updates as I please... I only have one username for MySQL ("root"), no one else uses my computer..
so, again: I need special privileges to access MySQL from Drupal that I don't need to access it from PHP env or from Tomcat??
(man, I can even connect to MySQL installed in my computer from stand-alone Java classes, no web server.. just plain windows or mac... and of course from unix shell too.. still don't get this MySQL issue with Drupal... )
thank you....
root db user should have all
root db user should have all privileges. If you are using root user as db username / password, should work. You can always check.
The privileges you require, and the command line method of adding them, are listed here http://drupal.org/documentation/install/create-database . At step 3 instead of listing them, you should be able to GRANT ALL.
I have seen these frustrating problems connecting to db before, both in my own experience and on the boards. Sometimes after days of struggle the questioner has finally found a typo in the db password. Happened to me and to others. Sometimes it is caused by incorrect db host name. But beyond that it is puzzling. I wonder whether there is a problem with you php setup, preventing php connecting to the db? You could try a php mysql-connect query if you are familiar with writing some php.
In addition people have had problems with some of the libraries on macs, and upgrades to mountain lion broke many mamp stack installations. So it might be worth googling for these issues, and correct installation of watever server stack you are using with whichever version of OS X you have. As said, Acquia dev desktop usually works out of the box. I have no experience of setting up a server stack on a mac so cannot really add anything on that level.
Sorry not to have a real answer!
Digit Professionals
can't you set this forum to
can't you set this forum to "watch" it so you get email notif. when you get a response?
oh man, I don't believe this..
ok, so are we talking privileges for a database or to connect to MySQL server?
I don't use a GUI to for MySQL, how do I set privileges from the shell (I mean connecting to MySQL thru the unix shell)
again, this is in my local machine, not on a web server or web hosting service...
as mentioned already previously, I have already created by the database (on the command-line client... it shouldn't matter how you create the database, I assume?)
is privileges the same as password? why do I need to set password for a database (I have a uid/pswd to connect to the server, but I've never had to set a password for a particular database..)
here are values I put in Drupal installation (screenshot)
http://mayacove.com/dev/drupal.gif
this is not correct? with Drupal I can't access databases with uid 'root'??? I don't get this...
I mean I don't understand this command:
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES, CREATE TEMPORARY TABLES ON `databasename`.* TO 'username'@'localhost' IDENTIFIED BY 'password';I ALREADY HAVE ACCESS TO ALL MY DATABASES;
man, this is driving me nuts... ok.. thank you....
edit: PS: these are the values I use to connect to MySQL server & db from PHP:
mysql_connect($dbhost,$dbuser,$dbpass) or die("Could not connect");the same dbhost, dbuser, & dbpass I use to conect from PHP are not good for connecting from Drupal?
thank you..
ok, I just ran this command
ok, I just ran this command MySQL command-line:
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES, CREATE TEMPORARY TABLES ON `dbName`.* TO 'root'@'localhost' IDENTIFIED BY 'pswd';so went to Drupal install again entered all info again, as shown here..
http://mayacove.com/dev/drupal.gif
now get this error:
Failed to connect to your database server. The server reports the following message: SQLSTATE[HY000] [2002] No such file or directory.I have no absolutely no idea what this means.. much, much more info is needed on this error... I have no idea what this
SQLSTATE[HY000] [2002]is...Sorry, I have been offline
Sorry, I have been offline for a while. But not sure what I can add. I know these mysql problems can be very frustrating. In your situation I would be tempted to try with a different setup (such as Acquia Dev Desktop) or a different machine.
I am suspecting there is a problem with your php setup, not being set up to effectively connect to your database. If you google the error message you find some info on this. Put another way, I am suspecting your MAMP setup is wrong (which would impact any php-driven CMS rather than being a Drupal-specific issue).
Digit Professionals
as mentioned in a previous
as mentioned in a previous post, I can connect to MySQL fine with PHP, with code I write myself.... as posted above, sample code:
mysql_connect($dbhost,$dbuser,$dbpass) or die("Could not connect");works like a charm... ;-) (and I put the same values I use for these vars in the Drupal install/setup...)
yes I googled the error, didn't enlighten me much....
what is MAMP? (I guess I need to google that one too....;-)
man, this is frustrating.. might try a MySQL forum somewhere....
thank you for your response...
I was assuming because you
I was assuming because you are on a Mac you were using MAMP (a ready built server stack for Macs). But of course that is far from the only way to set up an Apache / php / SQL server stack on a Mac.
Digit Professionals
well, Apache/PHP env came
well, Apache/PHP env came installed on the mac... and it works perfectly well.....
MySQL I installed myself, and to repeat: I can connect PERFECTLY WELL to MySQL form PHP environment (and from JSP env too, by the way...)
so prob is with Drupal, not with either PHP env or with MySQL.... (unless I'm doing something wrong in set-up, but well, have posted more than once on this thread what I've been doing for the set-up (even posted screenshots of errors...) and no one has been able to tell me what, if anything, I'm doing wrong...
thank you for your response...
(PS: can this forum be set up so you get an email notif. when you get a response??)