Configuration of Mac Apache and MySQL

Source: Internet
Author: User

Rapid development, you can download XAMPP, which has Apache and MySQL, installed click Start can start.

: https://www.apachefriends.org/zh_cn/download.html

Location of Apache

If you do not want to use the integration tool to try to install and configure yourself,

Mac comes with Apache, the system is hidden by default, you can open terminal input open/etc/

I found Apache2, which has a configuration file on Apache like httpd.conf.

Find the Project storage path

Open the Apache2 folder under Httpd.conf,command + F to find documentroot such as:

Find the project's storage path in/library/webserver/documents

In the terminal input open/library/webserver/documents can open the project's storage address, the project will be placed directly inside the good.

You can also modify the project's deployment path and modify the DocumentRoot.

Launch Apache

Apache Start-up sudo apachectl start

Apache Restart sudo apachectl start to restart Apache each time the configuration file is modified

Apache off sudo apachectl stop

Enter localhost or 127.0.0.1 in the browser to see "It works!" Even if it succeeds.

Modifying the Apache Access port

The default access port is 80, that is localhost:80 or 127.0.0.1:80, because it is the default, so we usually do not have to write him. But sometimes when 80 ports are occupied, we can only modify port 80 to make Apache run.

In the ' Project storage path ' Step httpd.conf we're going to have to change him again,

Search 80

Change 80 to 8081, specifically to a few no mandatory requirements, but it is best not to choose less than 1000.

Save after change, restart apache!, restart apache!, restart apache!

Address bar input localhost:8081 or 127.0.0.1:8081,it works!

Downloads for MySQL

: http://dev.mysql.com/downloads/mysql/

Download the bottom MAC OS X 10.11 (x86, 64bit), DMG Archive.

Installation.

Problems encountered with MySQL

Use Navicat for MySQL when not connected, (PS: password does not know)

MySQL Password problem solving method

This method takes the MySQL bar friend's help, the friend's reply.

Step1:

Apple--System preferences, bottom point MySQL close MySQL service in popup page (click Stop MySQL server)
Step2:
Enter Terminal input: cd/usr/local/mysql/bin/
Log in Administrator right after enter sudo su
Enter the following command to disable the MySQL authentication feature after entering the carriage return./mysqld_safe--skip-grant-tables &
MySQL will restart automatically after carriage return (the MySQL status in preferences will become running)


Step3.
Enter the command./mysql
Enter command FLUSH privileges after carriage return;
Enter the command after the SET PASSWORD for ' root ' @ ' localhost ' = PASSWORD (' Your new password ');


At this point, the password modification completed, can be successfully logged in.

This way we have both Apache and MySQL installed on Mac, and to make it easier to use MySQL, you might want to install a navicat for MySQL visual management tool.

Configuration of Mac Apache and MySQL

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.