Problems connecting to mysql using phpMyAdmin

Ali A Samii samii at me.com
Fri Nov 19 00:12:46 PST 2010


Found my.cfn

This is the contents of that file:

# /etc/mysql/my.cnf: The global mysql configuration file.

# This file can be simultaneously placed in three places:
# 1. /etc/mysql/my.cnf to set global options.
# 2. /var/lib/mysql/my.cnf to set server-specific options.
# 3. ~/.my.cnf to set user-specific options.
#
# One can use all long options that the program supports.
# Run the program with --help to get a list of them.
#
# The following values assume you have at least 32M RAM!

[client]
#password       = my_password
port            = 3306
socket          = __PREFIX/var/run/mysqld/mysqld.sock

[safe_mysqld]
err-log         = __PREFIX/var/log/mysql/mysql.err
pid-file	= __PREFIX/var/run/mysqld/mysqld.pid
socket		= __PREFIX/var/run/mysqld/mysqld.sock

[mysqld_safe]
err-log         = __PREFIX/var/log/mysql/mysql.err
pid-file        = __PREFIX/var/run/mysqld/mysqld.pid
socket          = __PREFIX/var/run/mysqld/mysqld.sock

[mysqld]
#skip-networking
skip-innodb
user            = mysql
pid-file        = __PREFIX/var/run/mysqld/mysqld.pid
socket          = __PREFIX/var/run/mysqld/mysqld.sock
port            = 3306
log             = __PREFIX/var/log/mysql/mysql.log
basedir         = __PREFIX
datadir         = __PREFIX/var/db/mysql
tmpdir          = /tmp
language        = __PREFIX/share/mysql/english
skip-locking
set-variable    = key_buffer=16M
set-variable    = max_allowed_packet=1M
set-variable    = thread_stack=128K

[mysqldump]
quick
set-variable    = max_allowed_packet=1M

[mysql]
#no-auto-rehash # faster start of mysql but no tab completition

[isamchk]
set-variable    = key_buffer=16 


I don't see any old_password or similar in that

On 19 Nov, 2010, at 09:09 , Ryan Schmidt wrote:

> Well something like:
> 
> <?php echo (int)mysql_connect('localhost', 'root', 'password');
> 
> replacing "password" with your root password. If it connects, it will print the connection number (greater than zero). If it fails, it will print error messages and then 0.
> 
> Try running it from the command line ("php mytest.php") and also from a web server (http://localhost/mytest.php).
> 
> 
> 
> On Nov 19, 2010, at 02:06, Ali A Samii wrote:
> 
>> Would you be able to provide me with the one line to put in the script?
>> 
>> On 19 Nov, 2010, at 08:53 , Ryan Schmidt wrote:
>> 
>>> The docroot should have no effect on your ability to connect to the MySQL server.
>>> 
>>> You can check whether you are using the old password algorithm by looking for a file called my.cnf and seeing if it contains a line "old-passwords" or similar.
>>> 
>>> To rule out phpmyadmin as the problem, you could try to write a one-line PHP script to connect to the database and print out whether it was successful. You can try to run this through apache as a web page, and also on the commandline ("php mytest.php"), to see if you get different results.
>>> 
>>> 
>>> On Nov 19, 2010, at 01:49, Ali A Samii wrote:
>>> 
>>>> Hi:
>>>> 
>>>> I am assuming, because I'm not sure how to check this) that the mysql server is NOT configured to use the "old" password algorithm. This is a fresh and clean install, using the MAMP wiki on trac.macports.com and a fresh install of all the various components and variants.
>>>> 
>>>> Using the same basic installation process (but with my documents root in the default /opt/local/apache2/..... hierarchy on another machine, I had no problems. The only difference here is the doc root.
>>>> 
>>>> On 19 Nov, 2010, at 08:44 , Ryan Schmidt wrote:
>>>> 
>>>>> Yes, your answer did get through, I just didn't have a response yet.
>>>>> 
>>>>> Only reason I can think of why you could connect to the MySQL server on the command line but not from PHP:
>>>>> 
>>>>> Is your MySQL server (or this root account, anyway) configured to use the "old" (MySQL < 4.1) password algorithm? If so that doesn't work with mysqlnd (which is what php5-mysql now uses by default) so you should either (ideally) upgrade to the "new" algorithm or if you must keep the old algorithm, then install php5-mysql with the +mysql5 variant.
>>> 
>> 
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2659 bytes
Desc: not available
URL: <http://lists.macosforge.org/pipermail/macports-users/attachments/20101119/0f896a5a/attachment.bin>


More information about the macports-users mailing list