ubuntu10.10 Apache+php+mysql安装

主要是为了装mysql,但使用phpMyAdmin能够方便的管理mysql,如此,准备把Apache+php+mysql全都装上。

 

安装步骤:

 

1、 Apache
$ sudo apt-get install apache2

2、Mysql
$ sudo apt-get install mysql-server

安装过程中,会提示设置root密码。

3、PHP
$ sudo apt-get install php5

4、MySQL for Apache PHP
sudo apt-get install libapache2-mod-auth-mysql
$
 sudo apt-get install php5-mysql


5、phpmyadmin 
$ sudo apt-get install phpmyadmin

测试:

1、打开 http://localhost 可以看到It works!

表示apache正常运行

 

2、在终端输入:sudo netstat -tap | grep mysql

tcp 0 0 localhost.localdomain:mysql *:* LISTEN -      

表示mysql正常运行

3、phpMyAdmin,会自动安装在/usr/share/phpMyAdmin下

在终端输入:cp -r /usr/share/phpmyadmin /var/www      将phpmyadmin文件复制到www文件夹下

浏览器输入: http://localhost/phpmyadmin                       打开mysql管理界面。

 

常用操作:

 

1、设置 mysql root 访问密码:

mysqladmin -u root -p 旧密码 password 新密码 

 

2、 

启动 mysql 服务

   /etc/init.d/mysql start service mysql start

停止 mysql 服务  

   /etc/init.d/mysql stop service mysql stop

重启 mysql 服务  

   /etc/init.d/mysql restart service mysql restart

 

3、

进入 mysql 数据库  

mysql -u root –p

根据提示输入 root 访问密码 , 显示如下信息,表明可以开始 mysql 操作:


Welcome to the MySQL monitor.  Commands end with ; or /g.

Your MySQL connection id is 1

Server version: 5.1.50-community-log MySQL Community Server (GPL)

 

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.

This software comes with ABSOLUTELY NO WARRANTY. This is free software,

and you are welcome to modify and redistribute it under the GPL v2 license

 

Type 'help;' or '/h' for help. Type '/c' to clear the current input statement.

 

mysql>


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值