Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

MYSQL access problem with phpmyadmin

Posted on 2010-08-24
11
Medium Priority
?
1,012 Views
Last Modified: 2013-12-13
I have searched everywhere and can not resolved this issue. I have a 64 bit macbook pro laptop.

I have installed the latest MYSQL for 64 bit mac
I have the latest version of PHP installed and working perfectly with php files.

When i try go to localhost/phpmyadmin I am faced with the login screen so that is all good.

On the login screen it gives me an warning :Cannot load the mcrypt extention although I have followed the instructions to in it which told me I needed to install not mycrypt but libmcrypt-2.5.8 which I have done

I have Xcode 3.2 tools installed and Netbeans.

My problem is when I enter the user 'root' and my password I have set, I either get the error #2002 Cannot log in to the MySQL server if using Safari, or if using Google Chrome I get to a page that tells me

"Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly"


I have set the path for the session files as /Users/elvin66/Sites/tmp

It was by default trying to write session files to /etc/tmp which is not writable. So I changed the path.

Everything I try I get errors and I am at the point of wanting to completely remove all applications to do with a web server and start over, or just go back to using my linux ubuntu server which works fine.

Can someone please guide me to getting this running properly. Many thanks in advance.
0
Comment
Question by:Mark Brady
  • 6
  • 5
11 Comments
 
LVL 7

Expert Comment

by:mchkorg
ID: 33519014
Hi,
Just two things I can see from here:

1) mcrypt : you have to install the PHP mcrypt extension, not the mcrypt library. Something like php5-mcrypt, not libmcryptxxx
I don't know if php-mcrypt is required or not. But on a fresh debian server I just installed with phpmyadmin, it installed php5-mcrypt because of dependencies :)

2) your session directory: of course the one you choosed is writeable by everyone

It will maybe solve your warning, not your problem.

For the problem, did you check the php log? send us some parts. Thanks. (same with the webserver's logs)

regards
0
 
LVL 20

Author Comment

by:Mark Brady
ID: 33520837
ok I will try locate the logs and post them.....
0
 
LVL 7

Expert Comment

by:mchkorg
ID: 33521081
On a Mac, I don't know.
But you'll find it in your php.ini
There's an error_log variable inside :)

Usually on a linux server, everything is in /var/log
But again, I don't have a Mac here to check, sorry
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 20

Author Comment

by:Mark Brady
ID: 33521245
No problems I have a linux system as well but the mac is different. Here is the last few lines from my
apache access log but they don't show much. The apache error log shows even less (just a bunch of errors about a php file with an undefined variable) but that is not the problem. Still trying to find the php error logs.....


127.0.0.1 - - [26/Aug/2010:01:26:52 +1200] "GET /phpmyadmin/themes/original/img/logo_right.png HTTP/1.1" 304 -
127.0.0.1 - - [26/Aug/2010:01:26:52 +1200] "GET /phpmyadmin/themes/original/img/b_help.png HTTP/1.1" 304 -
127.0.0.1 - - [26/Aug/2010:01:26:52 +1200] "GET /phpmyadmin/phpmyadmin.css.php?token=22d06891f18e0ba98ab5f2f2e574ec05&js_frame=right&nocache=3847305171 HTTP/1.1" 200 21786
127.0.0.1 - - [26/Aug/2010:01:26:52 +1200] "GET /phpmyadmin/themes/original/img/s_warn.png HTTP/1.1" 304 -
127.0.0.1 - - [26/Aug/2010:01:26:52 +1200] "GET /phpmyadmin/themes/original/img/s_error.png HTTP/1.1" 304 -
0
 
LVL 7

Expert Comment

by:mchkorg
ID: 33521437
Or, you locate your php.ini and force it to be somewhere you control

Or open the "terminal" and try something like :
find / -name "php" | grep error
No matter if it's named php_blah_log or log_blah_php
0
 
LVL 20

Author Comment

by:Mark Brady
ID: 33526993
Ok I managed to find the .err file for mysql in /usr/local/mysql/data/ and here is some of what is says:


100826 10:45:38 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
100826 10:45:38 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/mysql/data/ is case insensitive
100826 10:45:38 [Note] Plugin 'FEDERATED' is disabled.
100826 10:45:38  InnoDB: Started; log sequence number 0 44233
100826 10:45:38 [Note] Event Scheduler: Loaded 0 events
100826 10:45:38 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.1.50'  socket: '/tmp/mysql.sock'  port: 3306  MySQL Community Server (GPL)
100826 10:46:18 [Note] /usr/local/mysql/bin/mysqld: Normal shutdown

100826 10:46:18 [Note] Event Scheduler: Purging the queue. 0 events
100826 10:46:18  InnoDB: Starting shutdown...
100826 10:46:19  InnoDB: Shutdown completed; log sequence number 0 44233
100826 10:46:19 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

100826 10:46:19 mysqld_safe mysqld from pid file /usr/local/mysql/data/Mark-Bradys-MacBook-Pro.local.pid ended
100826 10:47:20 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
100826 10:47:20 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/mysql/data/ is case insensitive
100826 10:47:20 [Note] Plugin 'FEDERATED' is disabled.
100826 10:47:21  InnoDB: Started; log sequence number 0 44233
100826 10:47:21 [ERROR] /usr/local/mysql/bin/mysqld: unknown option '--autoclose'
100826 10:47:21 [ERROR] Aborting

100826 10:47:21  InnoDB: Starting shutdown...
100826 10:47:26  InnoDB: Shutdown completed; log sequence number 0 44233
100826 10:47:26 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

100826 10:47:26 mysqld_safe mysqld from pid file /usr/local/mysql/data/Mark-Bradys-MacBook-Pro.local.pid ended
100826 10:48:25 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
100826 10:48:25 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/mysql/data/ is case insensitive
100826 10:48:25 [Note] Plugin 'FEDERATED' is disabled.
100826 10:48:25  InnoDB: Started; log sequence number 0 44233
100826 10:48:25 [Note] Event Scheduler: Loaded 0 events
100826 10:48:25 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.1.50'  socket: '/tmp/mysql.sock'  port: 3306  MySQL Community Server (GPL)


That doesn't make much sense to me but here are some other things I tried.

I turned on all errors and warning in php.ini
I set the correct path to the mcrypt files. This is pasted from my php.ini file

[mcrypt]
; For more information about mcrypt settings see http://php.net/mcrypt-module-open

; Directory where to load mcrypt algorithms
; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt)
mcrypt.algorithms_dir= /usr/local/lib/libmcrypt

; Directory where to load mcrypt modes
; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt)
mcrypt.modes_dir= /usr/local/lib/libmcrypt

Although there aren't any files in that folder, just a folder. I even tried it without the 'libmcrypt' on the end as that is where a bunch of files are for mcrypt but still get that warning on the phpmyadmin login page.

Cannot load mcrypt extension. Please check your PHP configuration.
I have attached the apache2 error and access logs so you can see what they say. Thanks so much for your patience (mine has run out almost) I also attached my php.ini file
access-log
error-log
php.ini
0
 
LVL 20

Author Comment

by:Mark Brady
ID: 33527026
One thing I also noticed is that web sharing was turned on in my system preferences although
I have been told it is unsafe to have it turned on. When I turn it off, localhost does not work at all. I know in some applications possibly Xamp web sharing is required to be turned off. I'm confused.

Would it be better to try and uninstall or dump everything and go for a package to install all 3 applications? I tried Mamp but did not like it and couldn't access my databases even after setting permissions in the folders. I tried Xamp and that wasn't working either. Surely there must be a simple method of getting a damn web server running on a mac so I can do my work! I don't want it as a public server, just local development.
0
 
LVL 7

Expert Comment

by:mchkorg
ID: 33528409
Ok, would you post this one? error_log = /Users/elvin66/Sites/php_errors.log

Your apache error log doesn't tell much things. You have a timezone misconfiguration (I guess we don't care here) and something wrong in a script you must be writing (mark/index.php)

(It won't be a public server unless it's reachable from the outside. I doubt that, your mac must be on a LAN. It might be reachable from within your LAN.)
0
 
LVL 20

Author Comment

by:Mark Brady
ID: 33537136
I'm assuming you meant for me to put that line in my php.ini and see what it records ? Ok I'll do that now.
0
 
LVL 20

Accepted Solution

by:
Mark Brady earned 0 total points
ID: 33541179
I tried that error file and all it logged was php errors like Undefined index for $name in index.php on LINE 3
and a few other insignificant things. I have lost all faith in trying to get this going so I deleted everything and put MAMP back into my applications folder, and this time it worked! I can now open my php websites and mysql is allowing access so all is good.

I do appreciate your effort but in this case, it was better to move on for me as I have a lot of work to get done.
Much thanks
0
 
LVL 7

Expert Comment

by:mchkorg
ID: 33564745
ok
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question