Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
phpMyAdmin setup problem
#1
I've installed Apache, MySQL, and now I've installed phpMyAdmin. But there's a problem. I set my password and username in the mysql-win32 admin tool, and then I edited my phpMyAdmin config file to suit those usernames, passwords, and that other URI setting...the username and password math and everything is fine, but I'm still getting an Access Denied error when accessing phpMyAdmin.
Did I forget to do something?
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#2
I'm wondering if you actually DID add a new user when you used that tool. Did you try restarting MySQL? I believe you have to when you add new users but I may be wrong.

Suggestion... create a PHP script and connect to MySQL using the root user and then execute the following query (edited with your username/password of choice)

Code:
INSERT INTO `user` ( `Host` , `User` , `password` , `Select_priv` , `Insert_priv` , `Update_priv` , `Delete_priv` , `Create_priv` , `Drop_priv` , `Reload_priv` , `Shutdown_priv` , `Process_priv` , `File_priv` , `Grant_priv` , `References_priv` , `Index_priv` , `Alter_priv` , `Show_db_priv` , `Super_priv` , `Create_tmp_table_priv` , `Lock_tables_priv` , `Execute_priv` , `Repl_slave_priv` , `Repl_client_priv` , `ssl_type` , `ssl_cipher` , `x509_issuer` , `x509_subject` , `max_questions` , `max_updates` , `max_connections` )
VALUES (
'localhost', 'testuser', PASSWORD( 'testpassword' ) , 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', '', '', '', '', '0', '0', '0'
)

That should add a new user with ALL privileges (basically an exact cope of root).

Erm... assuming you CAN make PHP scripts to connect and do stuff with MySQL why not just set phpMyAdmin to connect with that user/password?

Arg... this post is rapidly turning into a sloppy mish-mash of crap... sorry but I keep thinking of new ways to add a user and make phpMyAdmin work lol.

Ok... in your config.inc.php file in the phpMyAdmin directory... with a freshly installed copy of MySQL (blank root password) you SHOULD be able to do this:

Code:
/**
* Server(s) configuration
*/
$i = 0;
// The $cfg['Servers'] array starts with $cfg['Servers'][1].  Do not use $cfg['Servers'][0].
// You can disable a server config entry by setting host to ''.
$i++;
$cfg['Servers'][$i]['host']          = 'localhost'; // MySQL hostname or IP address
$cfg['Servers'][$i]['port']          = '';          // MySQL port - leave blank for default port
$cfg['Servers'][$i]['socket']        = '';          // Path to the socket - leave blank for default socket
$cfg['Servers'][$i]['connect_type']  = 'tcp';       // How to connect to MySQL server ('tcp' or 'socket')
$cfg['Servers'][$i]['compress']      = FALSE;       // Use compressed protocol for the MySQL connection
                                                    // (requires PHP >= 4.3.0)
$cfg['Servers'][$i]['controluser']   = '';          // MySQL control user settings
                                                    // (this user must have read-only
$cfg['Servers'][$i]['controlpass']   = '';          // access to the "mysql/user"
                                                    // and "mysql/db" tables)
$cfg['Servers'][$i]['auth_type']     = 'config';    // Authentication method (config, http or cookie based)?
$cfg['Servers'][$i]['user']          = 'root';      // MySQL user
$cfg['Servers'][$i]['password']      = '';          // MySQL password (only needed
                                                    // with 'config' auth_type)
$cfg['Servers'][$i]['only_db']       = '';          // If set to a db-name, only
                                                    // this db is displayed
                                                    // at left frame
                                                    // It may also be an array
                                                    // of db-names
$cfg['Servers'][$i]['verbose']       = '';          // Verbose name for this host - leave blank to show the hostname

$cfg['Servers'][$i]['pmadb']         = '';          // Database used for Relation, Bookmark and PDF Features
                                                    // (see scripts/create_tables.sql)
                                                    //   - leave blank for no support
                                                    //     DEFAULT: 'phpmyadmin'
$cfg['Servers'][$i]['bookmarktable'] = '';          // Bookmark table
                                                    //   - leave blank for no bookmark support
                                                    //     DEFAULT: 'PMA_bookmark'
$cfg['Servers'][$i]['relation']      = '';          // table to describe the relation between links (see doc)
                                                    //   - leave blank for no relation-links support
                                                    //     DEFAULT: 'PMA_relation'
$cfg['Servers'][$i]['table_info']    = '';          // table to describe the display fields
                                                    //   - leave blank for no display fields support
                                                    //     DEFAULT: 'PMA_table_info'
$cfg['Servers'][$i]['table_coords']  = '';          // table to describe the tables position for the PDF schema
                                                    //   - leave blank for no PDF schema support
                                                    //     DEFAULT: 'PMA_table_coords'
$cfg['Servers'][$i]['pdf_pages']     = '';          // table to describe pages of relationpdf
                                                    //   - leave blank if you don't want to use this
                                                    //     DEFAULT: 'PMA_pdf_pages'
$cfg['Servers'][$i]['column_info']   = '';          // table to store column information
                                                    //   - leave blank for no column comments/mime types
                                                    //     DEFAULT: 'PMA_column_info'
$cfg['Servers'][$i]['history']       = '';          // table to store SQL history
                                                    //   - leave blank for no SQL query history
                                                    //     DEFAULT: 'PMA_history'
$cfg['Servers'][$i]['verbose_check'] = TRUE;        // set to FALSE if you know that your PMA_* tables
                                                    // are up to date. This prevents compatibility
                                                    // checks and thereby increases performance.
$cfg['Servers'][$i]['AllowDeny']['order']           // Host authentication order, leave blank to not use
                                     = '';
$cfg['Servers'][$i]['AllowDeny']['rules']           // Host authentication rules, leave blank for defaults
                                     = array();

... and it should work. (It does for me).

Hope something here helps. lol.
Reply
#3
I didn't...um...oh. :o
These were my steps:
Installed mysql, opened the win32 admin tool, set my username to [censored] and my password to [censored].
Installed phpMyAdmin. Set the cfguri. Set the username, password to those previously set for mysql.
Tried accessing pma...and...access denied.
:-? I couldn't really make anything of your post...sorry. :o
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#4
Try
username: root
password: [blank]
for the phpMyAdmin password.

the win32 mysql admin tool (assuming you are referring to winmysqladmin.exe) does not set up a MySQL user login to the best of my knowledge (didn't for me anyway... I had to do it manually).
Reply
#5
Of course I can use root, but that opens the server wiiiiiide.
The mysql admin tool? There's a tab that controls the config file. You can change the username and password from there.
I'm hoping now that I won't have to add stuff to tables using a php file. Sad
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#6
http://www.mysql.com/doc/en/Adding_users.html

Enjoy Tongue

If you have trouble figuring that out then just let me know.
Reply
#7
Adding users isn't my problem. My problem is that when trying to connect to mysql with the username and password I set, my access is denied. It works fine from a webpage. Using root with no passwords works.
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#8
Yes, but I think you're missing my point. I *believe* that when you think that you are adding users you in fact aren't... have you tried to connect via these MySQL users you created through a PHP script and tried to execute some queries?

Quote:The mysql admin tool? There's a tab that controls the config file. You can change the username and password from there.

MySQL users aren't stored in a config file. They're stored in the DB itself.
Reply
#9
*Shame*
I deleted that DB. *Lip quivers* *Cries*
Time to reinstall. Sad
And btw I didn't create the user from a php script, I created the first time mysqladmintool started up. Just like it prompted me to do. And connecting to databases from php scripts worked like that. But phpmyadmin configured...didn't.
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#10
No but what I'm wondering is... if you reinstall it all and when that admin tool prompts you for the username and password... say you entered Zack/password respectively... if you wrote a PHP script to connect and do stuff with MySQL using that exact same username/password, would it actually work? I bet it doesn't but I could be wrong.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)