漫步红林

品味技术与生活之间的差距,追求代码与国画之间的艺术.

BlogJava 联系 聚合 管理
  0 Posts :: 28 Stories :: 2 Comments :: 0 Trackbacks
   安装中标普华Linux操作系统

首先安装中标普华Linux操作系统,在第一个安装光盘内,选择光盘安装,然后选择自定义安装(不要选择典型安装,因为典型安装没有安装开发环境,例如:GCC),在安装途中会弹出两个安装图面,一个为通信协议(全选,包括SSH、FTP、HTTP、EMAIL),一个为开发环境(全选,包括GCC、图形界面等),然后根据提示一步一步安装下去。




网卡安装

    中标普华系统内核有些网卡驱动没有包含在内,需要进行安装,如果知道网卡型号,可以直接下载该网卡驱动进行安装,如果还不是很清楚网卡型号,则进行以下操作。

    在系统操作终端输入lspci命令后,查看Ethernet controller:信息,可以看出该网卡是什么产商、什么型号的。操作如下:

[root@localhost ~]# lspci

00:00.0 Host bridge: Intel Corporation: Unknown device 29c0 (rev 10)

00:01.0 PCI bridge: Intel Corporation: Unknown device 29c1 (rev 10)

00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 01)

00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 01)

00:1c.3 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 4 (rev 01)

00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #1 (rev 01)

00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #2 (rev 01)

00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #3 (rev 01)

00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #4 (rev 01)

00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 01)

00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev e1)

00:1f.0 ISA bridge: Intel Corporation 82801GB/GR (ICH7 Family) LPC Interface Bridge (rev 01)

00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 01)

00:1f.2 IDE interface: Intel Corporation 82801GB/GR/GH (ICH7 Family) Serial ATA Storage Controllers cc=IDE (rev 01)

00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 01)

01:00.0 VGA compatible controller: nVidia Corporation: Unknown device 0641 (rev a1)

02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd.: Unknown device 8168 (rev 02)

 通过网卡信息找到网卡驱动,将安装包拷贝到服务器上,根据安装说明进行安装。基本安装命令过程如下(下面是以8168网卡进行说明):

# lsmod | grep r8169

# rmmod r8169

#tar vjxf r8168-8.aaa.bb.tar.bz2

# cd r8168-8.aaa.bb

# make clean modules    (as root or with sudo)

# make install

# depmod -a

# insmod ./src/r8168.ko (or r8168.o in linux kernel 2.4.x)

# lsmod | grep r8168

# ifconfig -a

# ifconfig ethX up (X=0,1,2,...)

重新启动服务器,系统将在检测新硬件设备是提示出新安装的网卡,可以通过该界面进行网络配置,也可以进入系统进行设备网络配置。

 

Mysql数据库安装

    通过SSH客户端将mysql-5.0.22.tar.gz包拷贝到服务器后,打开Linux终端进行以下操作:

1. groupadd mysql

2. useradd -g mysql mysql

3. tar -zxvf mysql-xxxx.tar.gz

4. cd mysql-xxxx

./configure --prefix=/usr/local/mysql

5.make

6.make install

7./server/mysql/bin/mysql_install_db --user=mysql

8.cp support-files/my-medium.cnf /etc/my.cnf

9.cp support-files/mysql.server /etc/rc.d/init.d/mysqld

10. chmod 700 /etc/rc.d/init.d/mysqld

11. chkconfig --add mysqld

12. cd /server/mysql

13.chown -R root .

14. chown -R mysql var

15. chgrp -R mysql .

16. /server/mysql/bin/mysqld_safe --user=mysql &

17.在出现 mysqld ended 的时候.点击回车.回到命令行

18. bin/mysql -u root -p

19.系统会提示输入密码.由于我们安装时没有设置密码.所以默认密码为空.直接点击回车.

20. usr/bin/mysqladmin -u root password 'new-password'

格式:mysqladmin -u用户名 -p旧密码 password 新密码

21.测试是否修改成功

1)不用密码登录

[root@test1 local]# mysql

ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)

显示错误,说明密码已经修改。

2)用修改后的密码登录

[root@test1 local]# mysql -u root -p

Enter password: (输入修改后的密码123456)

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

Your MySQL connection id is 4 to server version: 4.0.16-standard

Type 'help;' or 'h' for help. Type 'c' to clear the buffer.

mysql>

成功!

    22.在防火墙内打开数据库端口3306

        vi /etc/sysconfig/iptables(按上面开放80,22端口的形式,加一条3306端口)

       打开防火墙和关闭防火墙的指令:

       1)即时生效,重启服务器后失效

开启: service iptables start

关闭: service iptables stop

2)重启服务器后生效

开启: chkconfig iptables on

关闭: chkconfig iptables off

23.分配远程连接数据库的权限

       进入MySQL,创建一个新用户xuys:   

       格式: grant 权限 on 数据库名.表名用户@登录主机 identified by "用户密码";

       grant select,update,insert,delete on *.* to xuys@192.168.88.234 identified by "xuys1234";

    查看结果,执行:

       use mysql;

       select host,user,password from user;

      可以看到在user表中已有刚才创建的xuys用户,host字段表示登录的主机,其值可以用IP,也可用主机名,将host字段的值改为%就表示在任何客户端机器上能以xuys用户登录到MySQL服务器,建议在开发时设为%.

       update user set host = '%' where user = 'xuys';
   
    24.
修改my.cnf配置文件(解决关于linux中mysql中编码的问题(UTF-8))

#linux my.cnf文件的放置位置

/etc/my.cnf

*************************************************************

不管什么时候,编码一定要统一,这是保证数据能正确入库的前提。

首先要配置你的mysql的默认编码方式为UTF-8。

其次mysql语句区分大小写,对此也需要进行修改。

具体看my.cnf的配置.

# vi /etc/my.cnf

#下面是很重要的=====================================

[client]

#password             = your_password

port                  = 3306

socket                = /tmp/mysql.sock

default-character-set = utf8

lower_case_table_names=1               -----不区别大小写

[mysqld]

port            = 3306

socket          = /tmp/mysql.sock

skip-locking

key_buffer = 16M

max_allowed_packet = 1M

table_cache = 64

sort_buffer_size = 512K

net_buffer_length = 8K

read_buffer_size = 256K

read_rnd_buffer_size = 512K

myisam_sort_buffer_size = 8M

default-character-set = utf8

lower_case_table_names=1                 -----不区别大小写

#*************************************************************

    25.启动和关闭、重启mysql数据库指令

/etc/rc.d/init.d/mysqld stop (停止mysql)

/etc/rc.d/init.d/mysqld start (启动mysql)

/etc/init.d/mysqld restart (重启mysql)

posted on 2009-02-26 19:34 苦瓜 阅读(961) 评论(0)  编辑  收藏 所属分类: Linux