Mở trình duyệt của bạn và truy cập http. //máy chủ cục bộ. Nếu nó báo It Works, thì bạn đã thiết lập, nếu không thì hãy xem apachectl của bạn đã khởi động hay chưa
2. Kích hoạt PHP cho ApacheHãy tạo một bản sao lưu của cấu hình Apache mặc định. Điều này sẽ giúp bạn kiểm tra chéo sau này những gì bạn đã thay đổi hoặc trong trường hợp bạn muốn khôi phục cấu hình về mặc định
cd /etc/apache2/
cp httpd.conf httpd.conf.bak
Bây giờ chỉnh sửa httpd. conf với vi hoặc bất kỳ trình soạn thảo văn bản nào khác.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.19 Homebrew
Copyright [c] 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
0Bây giờ bỏ ghi chú dòng sau [Xóa #].
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.19 Homebrew
Copyright [c] 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
1Bây giờ Khởi động lại apache.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.19 Homebrew
Copyright [c] 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
23. Cài đặt MySQLĐể cài đặt MySQL.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.19 Homebrew
Copyright [c] 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
3Cài đặt dịch vụ sản xuất bia ngay bây giờ.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.19 Homebrew
Copyright [c] 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
0Bây giờ bắt đầu MySQL.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.19 Homebrew
Copyright [c] 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
1Bây giờ cấu hình MySQL.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.19 Homebrew
Copyright [c] 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
2- Xác thực plugin mật khẩu
- Xóa người dùng ẩn danh
- Không cho phép root đăng nhập từ xa
- Xóa cơ sở dữ liệu thử nghiệm và truy cập vào nó
- Tải lại các bảng đặc quyền ngay bây giờ - Chọn có
Sau khi hoàn thành việc này, hãy kiểm tra MySQL.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.19 Homebrew
Copyright [c] 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
3Nó sẽ yêu cầu bạn viết mật khẩu mà bạn đã đặt cho mysql trước đó. Nhập mật khẩu và sau đó một cái gì đó như thế này xuất hiện
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.19 Homebrew
Copyright [c] 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
4. Kết nối PHP và MySQLBây giờ chúng ta cần đảm bảo PHP và MySQL
cd /var
mkdir mysql
cd mysql
ln -s /tmp/mysql.sock mysql.sock
Tất cả các trang web của bạn sẽ có các URL như http. //localhost/some-site trỏ đến /Library/WebServer/Documents/some-site
Lưu ý về Quyền
Bạn có thể nhận được 403 bị cấm khi truy cập trang web địa phương của mình. Người dùng Apache[
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.19 Homebrew
Copyright [c] 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
4] cần có quyền truy cập để đọc và đôi khi viết thư mục web của bạnBạn có thể thay đổi quyền như thế này.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.19 Homebrew
Copyright [c] 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
5 hoặc bạn có thể thay đổi quyền sở hữu thư mục thành người dùng và nhóm apache. Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.19 Homebrew
Copyright [c] 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
65. Cài đặt PHPMyAdminĐây là tùy chọn. Bạn có thể sử dụng MySQL thông qua dòng lệnh nhưng đây là cách tốt để quản trị MySQL. Tải xuống phpmyadmin từ trang web