Configure PhpMyAdmin on Mac

Source: Internet
Author: User
Tags apache php

One, the configuration of the Apache server environment

Because the PHP Apache environment is self-bringing on Mac OS, there is no need to install another package, simply configure it. First open the Terminal input command:

One of the following lines is not commented out and the comments are removed.

# LoadModule Php5_module libexec/apache2/libphp5.so

After that, you can restart Apache with the following command:

sudo apachectl restart  

Enter in the browser: http://localhost/, if present-- It works! Description The Apache PHP service environment was successfully configured.

II. installation and deployment of MySQL services

  Download the DMG installation package for MySQL first. Click to download the latest version.

Open the DMG file, there are three installation items, which I installed in three, mysqlstartupitem.pkg installation, MySQL will start with the system boot, mysql.prefpane that you can see the MySQL option in System Preferences, There is also a MySQL installation.

This will make the installation successful, turn on MySQL in System Preferences, and turn the service on. After installation, the default username is root and the password is empty. For security, we need to set a password.

Open the terminal, if you enter the MySQL prompt without this command, then you need to configure the MySQL Bin directory environment variables. The directory address is:/usr/local/mysql/bin/, which is added to the path variable. Here I introduce another method, in Terminal input command:

Vim ~/.bash_profile

Then append the following on the last side

#mysql  alias mysql= '/usr/local/mysql/bin/mysql '  alias mysqladmin= '/usr/local/mysql/bin/mysqladmin '

In this way, in the terminal to enter MySQL has this command, in fact, it is similar to our macro definition in C + +, the role of alias substitution.

  Then we change the root password, the command is as follows:

Mysqladmin-uroot Password Admin

This will change the root password to admin.

III. Installation and Deployment PhpMyAdmin

To manage MySQL, if the command line is more troublesome, open source PhpMyAdmin use C/s mode, easy to manage. Then we put on a phpmyadmin. It was developed by PHP and I am currently the latest version: 4.7.3, corresponding to-

The downloaded decompression is placed in the/library/webserver/documents/directory, the complete directory is:/library/webserver/documents/phpmyadmin/, then the command line into this directory, enter the following command:

CP config.sample.inc.php config.inc.php  vim config.inc.php  

Follow the changes below:

$cfg [' blowfish_secret '] = ';    Used for cookie encryption, random long string  $cfg [' Servers '] [$i] [' host '] = ' 127.0.0.1 ';    The MySQL daemon does IP binding

Then we can enter url:http://localhost/phpmyadmin/in the browser

User name: root password: admin

You can login to the MySQL admin interface at this point.

  At this point, we are done, since then we can be very easy, very tall on the play MySQL database, is not very excited! ~~

Configure PhpMyAdmin on Mac

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.