Fedora 17下配置 PHP编程环境

Fedora 17下配置 PHP编程环境过程记录:

一、安装 Mysql和Mysql-Server

# yum install mysql mysql-server
================================================================================
 Package                      架构        版本                仓库         大小
================================================================================
正在安装:
 mysql                        i686        5.5.23-1.fc17       fedora      4.5 M
 mysql-server                 i686        5.5.23-1.fc17       fedora      8.2 M
为依赖而安装:
 libaio                       i686        0.3.109-5.fc17      fedora       22 k
 perl-AnyEvent                noarch      5.27-7.fc17         fedora      319 k
 perl-AnyEvent-AIO            noarch      1.1-8.fc17          fedora      8.4 k
 perl-AnyEvent-BDB            noarch      1.1-7.fc17          fedora      8.4 k
 perl-Async-MergePoint        noarch      0.03-7.fc17         fedora       19 k
 perl-BDB                     i686        1.88-5.fc17         fedora       72 k
 perl-Coro                    i686        6.07-3.fc17         fedora      246 k
 perl-Curses                  i686        1.28-5.fc17         fedora       86 k
 perl-DBD-MySQL               i686        4.020-2.fc17        fedora      140 k
 perl-DBI                     i686        1.617-1.fc17        fedora      781 k
 perl-EV                      i686        4.03-8.fc17         fedora      251 k
 perl-Event                   i686        1.20-1.fc17         fedora      280 k
 perl-Event-Lib               i686        1.03-16.fc17        fedora       50 k
 perl-Glib                    i686        1.241-2.fc17        fedora      348 k
 perl-Guard                   i686        1.022-1.fc17        fedora       18 k
 perl-Heap                    noarch      0.80-10.fc17        fedora       46 k
 perl-IO-AIO                  i686        4.15-1.fc17         fedora      112 k
 perl-IO-Async                noarch      0.29-7.fc17         fedora      160 k
 perl-IO-Tty                  i686        1.10-5.fc17         fedora       39 k
 perl-POE                     noarch      1.350-2.fc17        fedora      583 k
 perl-Socket-GetAddrInfo      i686        0.19-1.fc17         fedora       32 k
 perl-Socket6                 i686        0.23-8.fc17         fedora       22 k
 perl-TermReadKey             i686        2.30-14.fc17        fedora       29 k
 perl-common-sense            noarch      3.5-1.fc17          fedora       26 k

事务概要
================================================================================
安装  2 软件包 (+24 Dependent packages)

总下载量:16 M
安装大小:81 M
确定吗?[y/N]:

然后就是下载安装了。

  • 完毕后打开服务

先来看下当前的端口情况:

# netstat -tnl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:55387           0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:7070          0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN     
tcp6       0      0 :::58520                :::*                    LISTEN     
tcp6       0      0 ::1:7070                :::*                    LISTEN     
tcp6       0      0 :::111                  :::*                    LISTEN     
tcp6       0      0 :::22                   :::*                    LISTEN     
tcp6       0      0 :::631                  :::*                    LISTEN
 

然后开启服务

# systemctl start mysqld.service

再来看看又增加了哪个端口?

# netstat -tnl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:55387           0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:7070          0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN     
tcp6       0      0 :::58520                :::*                    LISTEN     
tcp6       0      0 ::1:7070                :::*                    LISTEN     
tcp6       0      0 :::111                  :::*                    LISTEN     
tcp6       0      0 :::22                   :::*                    LISTEN     
tcp6       0      0 :::631                  :::*                    LISTEN

Yes!这个3306 就是mysql的端口了。

  • 设置mysql用户及密码
# mysqladmin -u 用户名 password 密码

这里用户名用自己想的来代替,密码不要告诉我。^-^

  • 检查数据库连接
# mysql -h localhost -u 用户名 -p
Enter password: 
Welcome to the MySQL monitor. ..........................
mysql>

以上省略部分内容,看到这个就表示mysql连接成功了。要退出mysql怎么办?在mysql>后输入\q

相关推荐