码迷,mamicode.com
首页 > 其他好文 > 详细

Bookstore project using XAMPP 详细配置 Part 1

时间:2016-03-08 02:11:10      阅读:262      评论:0      收藏:0      [点我收藏+]

标签:

这是学校的一个project,记录在这里,以备复习。主要是用XAMPP通过phpMyAdmin连接MySQL数据库,实现一个简单的查询功能。

Outline

  1. Setup of XAMPP
  2. Implementation of MySQL database in “phpMyAdmin”
  3. Create PHP page
  4. User interface and test cases

 

1. Setup of XAMPP

1) I downloaded the XAMPP from this link (http://www.apachefriends.org/en/xampp.html).  Since I already have IIS taking port 80, I need to modify the “httpd.conf” file by clicking on “Config” on “Apache”. Then find “Listen” to change it to 85 as the port for Apache (see line 58 in Figure 1 below).

技术分享 

Figure 1

 

2) Also I have installed MySQL before. So the port 3306 was taken. I need to setup another port for the MySQL in XAMPP. Edit “my.ini” by clicking “Config” on “MySQL”, then find “port” and change it from 3306 to 3307 (see line 20 and 28 in Figure 2 below).

技术分享

Figure 2

Here is the reference. (http://stackoverflow.com/questions/18177148/xampp-mysql-does-not-start)

  

3) After these, the XAMPP is finally set up (Figure 3).

技术分享

Figure 3

  

4) Type in “localhost:85”, it will show correctly (Figure 4).      

技术分享         

Figure 4

  

5) When I was trying to click on “phpMyAdmin”, it gave me the error message (Figure 5)

技术分享

After I did some research, I found most of the suggestions were talking about password and username settings in the “config.inc.php” file under the directory of “\xamp\phpMyAdmin”. But it’s not the case for me. What I did is to change “$cfg[‘Servers‘][$i][‘host‘]” to “127.0.0.1:3307” instead of original “127.0.0.1” (see Figure 6 and line 22 and 27 in Figure 7).

 技术分享

Figure 6

技术分享

Figure 7

Also notice that at line 22 in the file of “config.inc.php” (Figure 7), it states that the extension is “mysqli”. I was not aware of this at this stage, but it gave me a lot of trouble later in the implementation of search function of php in this assignment because “mysql” extension was used as the default method.

Also many suggest that it’s not a good practice to use “root” as the account for the database. I should avoid that in future.

Here are the references. They are not quite my case, but they helped me a lot figuring how to fix my case.

a) http://stackoverflow.com/questions/7180893/mysql-said-cannot-connect-invalid-settings-xampp

b) http://stackoverflow.com/questions/1276538/phpmyadmin-cant-connect-invalid-setings-ever-since-i-added-a-root-passwor).     

  

6) After all of these modifications, “phpMyAdmin” finally worked (Figure 8)

技术分享

Figure 8

Bookstore project using XAMPP 详细配置 Part 1

标签:

原文地址:http://www.cnblogs.com/wenchan/p/5252555.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!