Installation of MySQL under Mac

Source: Internet
Author: User
Tags mysql in phpmyadmin

Because of the recent need to decorate mantis for bug tracking, the process is documented here.

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:

sudo vim/etc/apache2/httpd.conf


One of them is like this.

#LoadModule Php5_module libexec/apache2/libphp5.so


Remove the previous # number.

Then open the share in System Preferences, put the Web share on the hook, as

To restart Apache, the command is as follows:

sudo apachectl restart


This allows you to enter http://localhost/in the browser, if any

It works!

Description of the successful configuration of the PHP environment

Below to configure the MySQL environment.

Download the DMG installation package for MySQL first. In: http://dev.mysql.com/downloads/mysql/

Open the DMG file, there are three installation items, which I installed in three, Mysqlstartupitem.pkg after installation, MySQL will start with the system boot, Mysql.prefpane indicates that you can see the MySQL option in System Preferences, and one is the 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 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 is,/usr/local/mysql/bin/, added to the path variable. Here I'll show you another way,

Enter in the terminal

sudo vim/etc/bashrc


And then join them in

#mysqlalias 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 12345


This changes the root password to 12345.

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 is: http://www.phpmyadmin.net/home_page/downloads.php

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,

Re-enter the command:


Follow the changes below:

$cfg [' blowfish_secret '] = ';//for Cookie encryption, random long string $cfg[' Servers ' [$i] [' host '] = ' 127.0.0.1 ';//mysql daemon does IP binding


You can now enter url:http://localhost/phpmyadmin/in the browser

The service name is: root

Password for the password you set.

You can login to the MySQL admin interface.

Installation of MySQL under Mac

Related Article

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.