Mac OS with MySQL, phpMyAdmin

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
JasonTC
Forum Commoner
Posts: 92
Joined: Wed Nov 02, 2005 11:05 am
Location: Grand Rapids, MI

Mac OS with MySQL, phpMyAdmin

Post by JasonTC »

I've just installed MySQL and phpMyAdmin on my PowerBook running OS X 10.4.3. On the command line, the mysql command is not even recognized. In phpMyAdmin, the main page says "#1045 - Access denied for user 'root'@'localhost' (using password: NO)". Any ideas on how to connect?

Thanks,
Jason
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

In the config file for phpMyAdmin, you can type in the credentials you need. The best way (IMO) is to set up the config file to use http authentication right to mysql. That way you don't have to store database passwords anywhere.

You may need to put the mysql command in your path so it can auto complete. Do a search for 'mysql' and see if the directory it's in is in your path. If not, just call 'mysql' with the fill path name and it should work.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
JasonTC
Forum Commoner
Posts: 92
Joined: Wed Nov 02, 2005 11:05 am
Location: Grand Rapids, MI

Post by JasonTC »

in the config file for phpMyAdmin, you can type in the credentials you need. The best way (IMO) is to set up the config file to use http authentication right to mysql. That way you don't have to store database passwords anywhere.
Is the config file config.inc.php? That file actually didn't exist on my computer until I created it. If not, where is the config file? How do I set up the config file to use http authentication right to mysql?
You may need to put the mysql command in your path so it can auto complete. Do a search for 'mysql' and see if the directory it's in is in your path. If not, just call 'mysql' with the fill path name and it should work.
How do I put the mysql command in my path? I've tried using the mysql command from the directory in which mysql is installed, but that didn't work.

Thanks,
Jason
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

The config file has to exist for phpMyAdmin to run. If it wasn't there, then maybe you've got a buggered installation.

As for putting mysql in your path, it's kind of a moot point if you can't even run mysql from the directory it's stored in.


Re-install phpmyadmin and see what happens.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
JasonTC
Forum Commoner
Posts: 92
Joined: Wed Nov 02, 2005 11:05 am
Location: Grand Rapids, MI

Post by JasonTC »

Okay, I made some progress. I re-installed phpMyAdmin. Turns out there was some stuff I was supposed to do that I didn't do last time, such as create a config file. Before, when I was going to localhost/phpMyAdmin/main.php, it was telling me I needed to make a config file, but I didn't know what it was talking about. Since then, I've figured it out. Now it's telling me this:
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in config.inc.php and make sure that they correspond to the information given by the administrator of the MySQL server.
I'm still getting the same "#1045 - Access denied for user 'control_user'@'localhost' (using password: YES) " as before.

I don't know how to set or check a user/pass for my MySQL server. How do I do that?

Thanks,
Jason
JasonTC
Forum Commoner
Posts: 92
Joined: Wed Nov 02, 2005 11:05 am
Location: Grand Rapids, MI

Post by JasonTC »

Also, I got the "mysql" command to work. So whatever you call the thing that runs when you type "mysql", I can get there, I just don't know what to do in there.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

Well, good progress :).

The default root password is blank I think, so mysql -u root should get you in correct? In the config file, set the 'auth_type' to 'http'. That should let you login using the credentials stored in mysql. Once in, create a new user and set a password. You should set a password for the root user as well.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
JasonTC
Forum Commoner
Posts: 92
Joined: Wed Nov 02, 2005 11:05 am
Location: Grand Rapids, MI

Post by JasonTC »

I used mysql -u root in the terminal and I got "#1045 - Access denied for user 'control_user'@'localhost' (using password: YES) ".

I tried mysql -u root -p and then typed in my password and that worked.

I still don't know what to do next, though. Where is the config file?
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

The config file should be in the phpMyAdmin directory. Look at the phpMyAdmin documentation for details on what to change.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
JasonTC
Forum Commoner
Posts: 92
Joined: Wed Nov 02, 2005 11:05 am
Location: Grand Rapids, MI

Post by JasonTC »

Code: Select all

<?php
/*
 * Generated configuration file
 * Generated by: phpMyAdmin 2.8.0.2 setup script by Michal ?~Liha?~Y <michal@cihar.com>
 * Version: $Id: setup.php,v 1.23.2.2.2.1 2006/03/08 19:06:48 nijel Exp $
 * Date: Thu, 30 Mar 2006 06:00:08 GMT
 */

/* Servers configuration */
$i = 0;

/* Server localhost (config:root) [1] */
$i++;
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['controluser'] = 'control_user';
$cfg['Servers'][$i]['controlpass'] = 'themoms';
#$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['auth_type'] = 'http';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'themoms';

/* End of servers configuration */

$cfg['LeftFrameLight'] = true;
$cfg['LeftFrameDBTree'] = true;
$cfg['LeftFrameDBSeparator'] = '_';
$cfg['LeftFrameTableSeparator'] = '__';
$cfg['LeftFrameTableLevel'] = 1;
$cfg['LeftDisplayLogo'] = true;
$cfg['LeftDisplayServers'] = false;
$cfg['LeftPointerEnable'] = true;
$cfg['EditInWindow'] = true;
$cfg['QueryWindowHeight'] = 310;
$cfg['QueryWindowWidth'] = 550;
$cfg['QueryWindowDefTab'] = 'sql';
?>
That's my config file. The username/password won't work with phpMyAdmin. What might be the deal with that?
Post Reply