NooB with questions...of course!

I’ve previously had php, Mysql running on this Mac (along with Apache, of course). but that was over a year ago and before an internal AND external drive failure! (One more strike??!!) :wink:

Anyway, I now have a newer version of Apache (from the OS re-install and update [10.6.5]) and downloaded the “Build Your Own Database Driven Web Site Using PHP & MySQL, 4th edition” PDF. The easy part, getting Apache is done; I get “It works!” via the localhost url, instead of the illustration in Fig. 1.22 on page 29. Red flag #1? :eek2:

I thought I had mySQL set up correctly but noticed some points where the book said I should get a request for my admin password and did not. However, things seemed to proceed normally, otherwise. Once I got to the top of page 28, the command line: mysqladmin status returned the expected “Uptime: 2987 Threads: 1 Questions: 16 Slow queries: 0 Opens: 15 Flush tables: 1 Open tables: 8 Queries per second avg: 0.5” That looked encouraging, right?

Now, I get to a more obvious problem: changing the password to mySQL. Page 45 checks the access to mySQL slightly differently, but it still outputs fine, as far as I can see: “Uptime: 3501 Threads: 1 Questions: 17 Slow queries: 0 Opens: 15 Flush tables: 1 Open tables: 8 Queries per second avg: 0.4

OK, lower part of page 45, ‘set the root password for [the] server:
mysqladmin -u root -p password “newpassword”
I carefully chose the same password as my computer admin account for now, certainly should not forget that one! However, here the book is a little disjointed. There is some text about how the world may stop if one forgets the new password and a blank line for writing down the new password and then the continuation of the process of actually changing the password back on page 45! I now see that the book says after entering the password changing command, that I am expected to just press Entersince the root user has no password at this point.” Excuse me? Didn’t I just tell mySQL to change the password? So, did I change the password or not?

What I did, before reading the part about simply entering “Enter” was to enter the new password. DOH! But, here is what I got:
mysqladmin -u root -p password “airbus1965”
Enter password: airbus1965
mysqladmin: connect to server at ‘localhost’ failed
error: ‘Access denied for user ‘root’@‘localhost’ (using password: YES)’

My first assumption was that I should not have included the quotation marks (not covered in the “Conventions used in this book”, BTW). Tried the same 'change password command, sans the quotes but got the same results. Of course…

BTW, mysqladmin -u root status still produces:
Uptime: 4526 Threads: 1 Questions: 18 Slow queries: 0 Opens: 15 Flush tables: 1 Open tables: 8 Queries per second avg: 0.3

And, mysqladmin -u root -p status still produces Uptime: 4621 Threads: 1 Questions: 19 Slow queries: 0 Opens: 15 Flush tables: 1 Open tables: 8 Queries per second avg: 0.4 simply by using “Enter.” According to page 47, I should be getting an “Access denied” message because root now has that new password.

Question: How many times should I do the same thing before getting different results?! :rofl:

Sorry for such verbosity, just trying to provide enough details to get anyone who wants to help me on the same page. And, if I don’t hear from anyone by then, Merry Christmas!" :hohoho:

Hi,
Do you want to change MySQL password?, this is what i get from the whole post.
By default MySQL does not create password(depends on the OS and software stack).
Just to give hints even i am not a Mac user, open konsole:

cd /usr/local/mysql
bin/mysql -u root mysql

Now we are already in, to user root with mysql database.
Need to run update command to update user table to change root password or any user.

UPDATE user SET Password = PASSWORD('[B]newpass[/B]') WHERE User = 'root';

And then

FLUSH PRIVILEGES;

Is this what you are after?
If not sorry ignore this post.

Regards.

When it asks you to enter a password, enter nothing just hit enter.


[FONT=Courier New]mysqladmin -u root -p password "airbus1965"[/FONT]
[FONT=Courier New]Enter password: [/FONT][FONT=Verdana][LEAVE BLANK][/FONT]

If I understand what is going on of course. The above command is not executed right away, so you have not changed the password yet. You get “Enter password” to authiticate that you have permission to change the password. However, since no password is entered yet, the value is blank. Hope my rambling made sense… x.x

First, please accept my apologies for such a delayed response. No good excuse, just busy with family matters, etc.

mmarif4u, you are absolutely correct in my need; change/set a password for my install of MySQL.

logic_earth, that is exactly what I saw.

I was finally able to get a status report by using a password that I didn’t think I had successfully created.

$ mysqladmin -u bono1965 status

gave me:

Uptime: 147  Threads: 1  Questions: 75  Slow queries: 0  Opens: 15  Flush tables: 1  Open tables: 8  Queries per second avg: 0.510

But when I tried the same request but with a password required:

$ mysqladmin -u bono1965 -p status

I get this:

Enter password: 
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'bono1965'@'localhost' (using password: YES)'

At least I now know exactly where MySQL is installed on my drive. But I may simply delete everything and start over. Any other suggestions gladly accepted. :wink:

BTW, I visited these pages and got basically the same suggestions you guys gave me.

[center]<[color=red][b]Change root Password[/b][/color]>
<[color=red][b]Recover root Password[/b][/color]>[/center]

Hi xairbusdriver,
Is user bono1965 exist?

Open konsole and enter this(to make the things simple):

mysql -u root -p

It will ask for password, just hit enter without anything to type because you haven’t have any password yet.

Lets us know what results you got from it.

Actually, “bono1965” did exist when I used the commands above. And I changed the password which it works now with your

mysql -u root -p

. I am now at the MySQL command line, “>” :weee: :tup:

mysqladmin -u root -p status

Also works and I get the proper report/information:

Uptime: 943  Threads: 1  Questions: 5  Slow queries: 0  Opens: 15  Flush tables: 1  Open tables: 8  Queries per second avg: 0.5

That info is now saved, backed up, duplicated and cloned! Thanks for the help! And your patience, especially since I seemed to have created the problem myself! :x :rolleyes:

Hope you all have a great Holiday (Christmas :frosty: for me!)!

Glad to hear that.
Happy holidays! :slight_smile: