本文主要记录phpMyAdmin在Mac OS X上的配置和使用,避免朋友们走弯路,浪费不必要的时间。
 
1. 下载: 
 
2. 在"设置"中打开" web share", 即可开启Mac自带的Apache, 也可以通过sudo apachectl restart, 重启Apache。
 
3. 源码放入 Apache的配置文件—httpd.cnf中DocumentRoot项指定的目录中,并打开php5的module
   #LoadModule php5_module libexec/apache2/libphp5.so
  改为: LoadModule php5_module libexec/apache2/libphp5.so
 
4. 修改DocumentRoot下地phpmyadmin源码的访问权限。 chmod -R 755 phpMyAdmin-4.4.1/
 
5. 配置Apache的httpd.conf  如下:
<Directory "/Library/WebServer/Documents/phpMyAdmin-4.4.1">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Allow from all
</Directory>
 
6.在phpMyAdmin-4.4.1目录下,复制config.example.inc.php 保存为:config.inc.php ,并修改其部分内容:
$cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

/*
* Servers configuration
*/
$i = ; /*
* First server
*/
$i++;
/* Authentication type */
$cfg['Servers'][$i]['user'] = 'root'; //mysql username here
$cfg['Servers'][$i]['password'] = 'xxxx'; //mysql password here
$cfg['Servers'][$i]['auth_type'] = 'config'; /* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = false;

如果你忘记了mysql 密码,可以通过如下方法修改:

    1. sudo /usr/local/mysql/bin/mysqld_safe --skip-grant-tables -u root &
    2. "sudo /Library/StartupItems/MySQLCOM/MySQLCOM start”  可跳过,原因未知
    3.  Then you should be able to log into MySQL as root:   "/usr/local/mysql/bin/mysql -u root"
    4. 修改密码: "UPDATE mysql.user SET Password = PASSWORD( 'new-password' ) WHERE User = 'root';"
          "FLUSH PRIVILEGES;"
          "quit;"
     5.  尝试用新密码登陆: "/usr/local/mysql/bin/mysql -u root -p"
 
7. 即将大功告成!此时,如果你通过sudo apachectl restart, 重启Apache,并通过网络地址访问,可能还是会提示你出错: mysql said: cannot connect: invalid settings. 
   
这可能是应为phpmyadmin 默认使用/var/mysql/mysql.sock来连接mysqld.
 
8. 为phpmyadmin 的默认sock目录创建一个连接到真实sock的链接。
     8.1  sudo mkdir /var/mysql/
     8.2  sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock
 
9.最后fuck , 一个为程序员准备的产品,竟然不提示详细的stack, 如不进行上一步,连错误提示都他妈草草了事,浪费劳资多少时间。
 
 
Mac下使用brew install phpmyadmin 安装方案
 
localhost:~ xxx$ brew install phpmyadmin
==> Installing phpmyadmin from josegonzalez/homebrew-php
==> Downloading https://github.com/phpmyadmin/phpmyadmin/archive/RELEASE_4_4_4.t
######################################################################## 100.0%
==> Caveats
Note that this formula will NOT install mysql. It is not
required since you might want to get connected to a remote
database server.

Webserver configuration example (add this at the end of
your /etc/apache2/httpd.conf for instance) :
  Alias /phpmyadmin /usr/local/share/phpmyadmin
  <Directory /usr/local/share/phpmyadmin/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    <IfModule mod_authz_core.c>
      Require all granted
    </IfModule>
    <IfModule !mod_authz_core.c>
      Order allow,deny
      Allow from all
    </IfModule>
  </Directory>
Then, open http://localhost/phpmyadmin

More documentation : file:///usr/local/Cellar/phpmyadmin/4.4.4/share/phpmyadmin/doc/

Configuration has been copied to /usr/local/etc/phpmyadmin.config.inc.php
Don't forget to:
  - change your secret blowfish

  - uncomment the configuration lines (pma, pmapass ...)
 
1. 修改/etc/apache2/httpd.conf , 并记得启用php5.mod
 
 
2. 修改上述的phpmyadmin.config.inc.php中的配置
 
 
3. 为phpmyadmin 的默认sock目录创建一个连接到真实sock的链接。
     3.1  sudo mkdir /var/mysql/
     3.2  sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock
     
     
4. sudo apachectl restart
 
 
------------------------- Install phpmyadmin on Ubuntu------------------------------
1. install phpmod   for apache2
2. install phpmysql for phpmyadmin to connect and manage mysql
3. download  source code of phpmyadmin from http://www.phpmyadmin.net/home_page/downloads.php.
4. untar the downloaded phpadmin ,
     4.1. move it to /var/www/html/
     4.2 chmod -R 755 ./phpmyadmin/
5. setting connection options for phpmyadmin .

在phpMyAdmin-4.4.1目录下,复制config.example.inc.php 保存为:config.inc.php ,并修改其部分内容:
$cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

/*
* Servers configuration
*/
$i = 0; /*
* First server
*/
$i++;
/* Authentication type */
$cfg['Servers'][$i]['user'] = 'root'; //mysql username here
$cfg['Servers'][$i]['password'] = 'xxxx'; //mysql password here
$cfg['Servers'][$i]['auth_type'] = 'config'; /* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = false;
6. check apache2.conf which located in /etc/apache2/ 
    whether /var/www is granted to access
7.  apache2ctl restart
 
参考:
1. http://stackoverflow.com/questions/13357561/error-1045-cannot-log-in-to-mysql-server-phpmyadmin
2. http://coolestguidesontheplanet.com/installing-phpmyadmin-on-mac-osx-10-7-lion/
 

phpMyAdmin在Mac OS X上的配置和使用的更多相关文章

  1. Mac OS X上安装配置apache服务器

    说明:Mac在安装完成Mac系统的时候它已经自带了apache服务器,接下来就是配置和将它启动运行了.那么接下来要做的事情就是: 1.配置apache的配置文件 2.设置虚拟主机 启动并查看apach ...

  2. Mac OS X 上安装 ASP.NET 5

    在Mac OS X Yosemite 10.10.3 中搭建第一个 ASP.NET 5 Web 项目 终于有时间在 Mac 上安装一下 ASP.NET 5,网上有许多教程,但是多数的时间比较早了,版本 ...

  3. Mac OS X上用CoreCLR运行一个真正的.NET控制台程序

    这个真正的控制台程序来自corefxlab,名叫CoreClrHelloWorld,是一个跨平台的.NET控制台演示程序,可以显示微软.Linux.苹果的logo. CoreClrHelloWorld ...

  4. Mac OS X上搭建Apache、PHP、MySQL的Web服务器

    mac OS 系统太帅了,安装php的环境如此简单,大赞一个! 转载自http://jingyan.baidu.com/article/39810a23e1939fb636fda6a9.html 在M ...

  5. Swig在Mac OS X上的安装

    网上有很多类似文章介绍Swig怎么在Mac OS X上安装和配置,一般来说就是: 下载pcre,configure & make & make install 下载swig,confi ...

  6. 基于MAC OS 操作系统安装、配置hadoop

    在Mac上安装Hadoop 对我这个之前从未接触过*nix的用户来说,使用命令行来做一系列的事情还是废了一番功夫.特写这个记录,以做备份. 获取Java 我的Mac运行的操作系统是OS X 10.7 ...

  7. Mac OS X上使用Wireshark抓包

    Wireshark针对UNIX Like系统的GUI发行版界面采用的是X Window(1987年更改X版本到X11).Mac OS X在Mountain Lion之后放弃X11,取而代之的是开源的X ...

  8. 如何在Mac OS X上安装 Ruby运行环境

    对于新入门的开发者,如何安装 Ruby和Ruby Gems 的运行环境可能会是个问题,本页主要介绍如何用一条靠谱的路子快速安装 Ruby 开发环境.此安装方法同样适用于产品环境! 系统需求 首先确定操 ...

  9. 在 Mac OS X 上创建的 .NET 命令行程序访问数据库 (使用Entity Framework 7 )

    var appInsights=window.appInsights||function(config){ function r(config){t[config]=function(){var i= ...

随机推荐

  1. php安装gearman扩展实现异步分步式任务

    参考: 1.小喵爱你的博客 2.PHP Manual 依赖 1.gcc44 2.boost >=1.39 3.libevent 4.php5.3+ 5.update ld.so.conf 安装依 ...

  2. 教你把UltraEdit如何注册激活教程及UltraEdit 22.0.0.48 官方中文版下载

    UltraEdit 22.0.0.48 官方中文版下载:链接: http://pan.baidu.com/s/1i3f7mZV 密码: r23v2015-5-30号更新 第一.关闭网络连接(或者直接拔 ...

  3. poj 1325 Machine Schedule

    Time Limit: 1000 MS Memory Limit: 10000 KB 64-bit integer IO format: %I64d , %I64u   Java class name ...

  4. linux xwiki搭建过程

    安装mysql数据库,并创建xwiki数据库及用户 mysql> create database xwiki; Query OK, 1 row affected (0.00 sec) mysql ...

  5. IHttpActionResult – new way of creating responses in ASP.NET Web API 2

    先收藏这篇文章. http://www.strathweb.com/2013/06/ihttpactionresult-new-way-of-creating-responses-in-asp-net ...

  6. [Xamarin] 客製化的ListView之章 (转帖)

    上次我們說到簡單的的SimpleExpandableListItem1 來做選單 老闆不會因為這樣而滿足的,因為總是希望一個獨一無二,而且漂亮的List 選單 這篇我們來看看如何實作最後結果為自訂每一 ...

  7. 深入理解javascript 中的 delete(转)

    在这篇文章中作者从<JavaScript面向对象编程指南>一书中关于 delete 的错误讲起,详细讲述了关于 delete 操作的实现, 局限以及在不同浏览器和插件(这里指 firebu ...

  8. [ThingWorx] Install PostgreSQL Issue

    ThingWorx application need PostgreSQL, I try configurate it in macbook. The first step is install Po ...

  9. [BTS] Error biztalk arguments null exception string reference not set to an instance of a string. parameter name

    biztalk arguments null exception string reference not set to an instance of a string. parameter name ...

  10. atitit.动态加载数据库配置in orm hibernate mybatis

    atitit.动态加载数据库配置in orm 1. 动态加载数据库配置的优点::: 1 1.1. 组合多个配置文件... 1 1.2. 连接多个数据库 1 2. 基本的流程:::getCfg内存对象, ...