Saturday , July 27 2024

Install phpMyAdmin on CentOS 5/RHEL (Linux)

Chào các bạn, bài này mình sẽ hướng dẫn các bạn cách cài đặt phpMyAdmin trên CentOS 5, các phiên bản khác các bạn cũng làm tương tự.

Yêu cầu

– Đã cài đặt apache/httpd

– Đã cài đặt PHP 5.2 trở lên và MySQL, nếu bạn chưa cài thì vào 2 link sau: Cài đặt PHP 5.3 và Cài đặt MySQL Server

– Các bạn có thể chạy  “yum update -y” để cập nhật tất cả những phần cần thiết và còn thiếu của hệ thống.

Cài đặt phpMyAdmin

1. Các bạn chạy các lệnh sau

1
2
3
4
5
6
# cd /var/www/html
# wget http://sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/3.5.2.2/phpMyAdmin-3.5.2.2-all-languages.tar.gz/download
# tar xvfz phpMyAdmin-3.5.2.2-all-languages.tar.gz
# mv phpMyAdmin-2.11.11.3-english phpMyAdmin
# cd phpMyAdmin
# cp config.sample.inc.php config.inc.php

2. Các bạn chỉnh sửa file config.inc.php trong thư mục phpMyAdmin ở trên

Tìm:

1
$cfg['Servers'][$i]['auth_type'] = 'cookie';

Sửa thành:

1
$cfg['Servers'][$i]['auth_type'] = 'http';

Các bạn có thể sửa cookie thành http hoặc để mặc định là cookie cũng vẫn được, lát nữa bạn sẽ chạy trên trình duyệt để kiểm tra sự khác biệt của 2 cách này.

Tiếp theo tìm:

1
$cfg['Servers'][$i]['AllowNoPassword'] = false;

Sửa thành:

1
$cfg['Servers'][$i]['AllowNoPassword'] = true;

Các bạn có thể sửa thành true hay để mặc định là false đều được, sự khác biệt là:

Khi bạn để là true thì khi bạn truy cập vào phpMyAdmin sẽ cho phép bạn nhập mật khẩu rỗng, ngược lại nếu là false thì yêu cầu mật khẩu của user đăng nhập phải khác rỗng.

Tài khoản để đăng nhập vào phpMyAdmin là sử dụng tài khoản của MySQL, mặc định khi bạn cài xong MySQL thì có user là root và mật khẩu là rỗng. Bạn có thể thay đổi mật khẩu của root hoặc thêm mới một user nếu muốn.

Đó là 2 thông số cần lưu ý nhất, các thông số còn lại các bạn có thể tự tìm hiểu sau.

3. Tạo file phpmyadmin.conf

# echo "Alias /phpmyadmin /var/www/html/phpMyAdmin" >> /etc/httpd/conf.d/phpmyadmin.conf

Sau khi tạo xong file phpmyadmin.conf có nội dung “Alias /phpmyadmin /var/www/html/phpMyAdmin” thì các bạn kiểm tra file /etc/httpd/conf/httpd.conf

Xem nếu file httpd.conf đã có dòng:

1
Include conf.d/*.conf

thì ok, còn nếu chưa có dòng đó thì các bạn thêm vào file httpd.conf với nội dung như sau:

1
Include conf.d/phpmyadmin.conf

4. Kiểm tra kết quả

Các bạn chạy trên trình duyệt với URL có dạng như sau:

http://yourdomain/phpmyadmin

hoặc

http://YourIPAddress/phpmyadmin

Nếu cài trên localhost thì là

http://localhost/phpmyadmin

Vậy là chúng ta đã cài đặt xong phpMyAdmin.

Chúc các bạn thành công!

About Ngo Thang IT

Check Also

login ssh root password vps google cloud

Cách đăng nhập SSH root bằng mật khẩu trên VPS Google Cloud

Xin chào, bạn đã tạo được VPS (VM Instance) trên Google Cloud nhưng muốn đăng …

8 Bình luận

  1. I simply want to tell you that I am just all new to blogging and honestly liked your blog site. Most likely I’m likely to bookmark your website . You really have beneficial well written articles. Thanks for sharing your website.

  2. I consider something truly interesting about your web blog so I saved to favorites .

  3. If you are needing to produce alteration in an individuals llife, during i would say the Are normally Bodyweight peeling off pounds training course are a wide path in the direction of gaining any search. la weight loss

  4. Greetings, super job, basically wasnt so busy with my looking I just read your full weblog. I ought to say i have to express gratitude!

  5. Some actually intriguing information , properly written and broadly speaking user pleasant.

  6. It’s really a great and helpful piece of info. I am happy that you just shared this useful info with us. Please stay us informed like this. Thanks for sharing.

  7. It is best to participate in a contest for top-of-the-line blogs on the web. I’ll recommend this website!

  8. Whats up very nice site!! Guy .. Beautiful .. Amazing .. I’ll bookmark your web site and take the feeds additionally¡KI’m satisfied to search out a lot of helpful information here in the put up, we want develop more techniques on this regard, thanks for sharing. . . . . .

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Đăng Ký Nhận Tin Qua Email

Nhận thông tin bổ ích về WordPress, Hosting, Thủ thuật website, Download miễn phí....và các phần quà hấp dẫn qua email.

* là bắt buộc