Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

TheReef

macrumors 68000
Original poster
Sep 30, 2007
1,888
167
NSW, Australia.
Help :(

After eventually installing and getting MySQL running (green light in System Preferences), I can't access my database. (I installed using terminal, but am very unfamiliar with it)
I can't use the official MySQL Administrator, nor phpMyAdmin.

When I log into phpMyAdmin with root, root I get:
#1045 - Access denied for user 'root'@'localhost' (using password: YES)

I tried to reset my password but get access denied errors……I have no idea.
I am using Leopard.

I've searched a lot, but it's down to my lack of Terminal knowledge, I think it's because I can't log into Mac OS X as root, but again I have no idea.


Please I need some help :(
 
Are phpmyadmin and mysql both running on the same machine?

To make sure that mysql is indeed working as it should, you should try this on the machine running mysql:

Open up terminal.app:

Code:
/usr/local/mysql/bin/mysql -u root -p

It should ask you for a password, enter what you think your password is, and see if that allows you to login.

P.S. Almost every day is full of mysql woe for me. Get used to it :)
 
Thanks for your reply :)! Yep, everything is running on my machine.

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

Looks like I've forgotten it…how would I reset my password…could I find it in any of my config files?
(again I've tried but Terminal isn't friendly with my inputs)
 
It's not clear whether phpmyadmin needs extra configuration or whether there's a problem with your mysql install. Let's try to establish that mysql is working fine first, then move on to phpmyadmin. The mysql passwords are stored in the mysql db in a table called user, so no, not in a config file.

Ok, so that means that either mysql server isn't running or the mysql.sock file is located elsewhere. It doesn't matter though, try this instead:

Code:
/usr/local/mysql/bin/mysql -u root -h localhost --protocol=tcp -p
 
Eh sorry, disreguard that last error, I had MySQL turned off as some websites had instructed to do…

With MySQL turned ON I get

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

When entering

Code:
/usr/local/mysql/bin/mysql -u root -h localhost --protocol=tcp -p

or

Code:
/usr/local/mysql/bin/mysql -u root -p
 
Sounds like you've forgotten your password. How did you setup mysql?

Shutdown mysql using the System Preferences interface.

Then run this:

Code:
/usr/local/mysql/bin/mysqld_safe --skip-grant-tables --autoclose

That will start mysql with any security. phpmyadmin should then work, and you might be able to change the root password from there. If not, you can do it via the terminal:

Code:
/usr/local/mysql/bin/mysql -u root

then :
Code:
SET PASSWORD FOR root@localhost=PASSWORD('mynewpassword');
 
I haven't even been able to log into it yet, I haven't created anything.
EDIT: I just noticed you edited your above post.
EDIT2: When running

Then run this:

Code:
/usr/local/mysql/bin/mysqld_safe --skip-grant-tables --autoclose
That will start mysql with any security. phpmyadmin should then work, and you might be able to change the root password from there. If not, you can do it via the terminal:

I get a whole lots of stuff saying permission denied.


EDIT3:
When running
/usr/local/mysql/bin/mysql -u root
I get
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

EDIT 4: I set up MySQL through following an online walkthrough, using Terminal. I don't know what I've done…should I reinstall maybe? I tried MAMP and that doesn't work either. I have Apache with PHP working fine though.
 
I haven't even been able to log into it yet, I haven't created anything.

Stop your mysql server. Then type this to create a fresh db:
Code:
sudo /usr/local/mysql/scripts/mysql_install_db --user=mysql

Start your sever.

Then try:
Code:
/usr/local/mysql/bin/mysql -u root
 
Code:
Could not find ./bin/my_print_defaults

If you are using a binary release, you must run this script from
within the directory the archive extracted into.  If you compiled
MySQL yourself you must run 'make install' first.
:eek:
 
Where did you get your mysql install from?

Try this instead:
Code:
cd /usr/local/mysql/
sudo /usr/local/mysql/scripts/mysql_install_db --user=_mysql
 
I am pretty sure mysql.com.
I remember I first downloaded the intel version by mistake (because it said 10.5) so then I downloaded the PPC version (10.4). I installed the PPC version.

I should probably just start again, but don't known how to remove whatever I have done.

EDIT 2:

Try this instead:
Code:
cd /usr/local/mysql/
sudo /usr/local/mysql/scripts/mysql_install_db --user=_mysql

OK stuff came up…"Filling help tables..."

EDIT 3: But again, starting the server and typing
./bin/mysqladmin -u root password 'newpassword'
Gives me access denied.
 
When you run 'mysql_install_db' it will create all the necessary databases and it should create a 'root' user without a password set. So in theory,

Code:
/usr/local/mysql/bin/mysql -u root

should just work.
 
Try:

Code:
cd /usr/local/mysql/
sudo rm -rf data
sudo /usr/local/mysql/scripts/mysql_install_db --user=_mysql
/usr/local/mysql/bin/mysql -u root
 
Bahh, I get access denied for the last line……
I will attempt to reinstall everything, sorry to keep you so late, thanks heaps for your assistance :)

p.s can you link me to the appropriate download for a powermac g5…I seam to be really stuffing up.
 
Bahh, I get access denied for the last line……
I will attempt to reinstall everything, sorry to keep you so late, thanks heaps for your assistance :)
No worries. It's only midday here :)

Yeah, if that last bunch of commands failed then it does sound as if there is something wrong with your installation. A re-install sounds like a good idea.
 
Ok, cheers :)
Hmmm, my dashclock says it's nighttime over there hehe :rolleyes:
I'll report back after I reinstall, but probably tomorrow.

EDIT:
Hmmm, my dashclock says it's nighttime over there hehe
Never mind…:rolleyes:

EDIT 2:[Below] thankyou bye :)[/Below]
 
Yes!
The installer you linked me too works great, I have reinstalled, changed my password and everything is working smoothly! thankyou very much for your help! :):D
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.