bitsCN.com
三四年没有安装过mysql+apache+PHP的环境了,我以前是做银行性能测试外包服务的,在甲方开发中心遇到这样环境的项目也比较少,大多是WebLogic/WebSphere+Oracle/DB2架构的大型系统。涉足电商行业方面的项目,不得不再去温故那些几乎遗忘的IIS、apache、MSsql、mysql等环境。
平台:VMware上虚拟的centos4.7
宿主机:windows
安装mysql前准备:
1、检查该环境中是否已安装mysql,检查方法:netstat –ano命令查看mysql默认端口3306是否存在;或者再命令行中执行mysql
2、下载mysql安装包
在http://www.mysql.com/downloads/mysql/#downloads下载mysql安装包:
MySQL-server-5.5.28-1.linux2.6.i386.rpm
MySQL-client-5.5.28-1.linux2.6.i386.rpm
使用rpm –ivh命令来安装mysql,这里不说啦。
先来了解一下mysql数据库默认的一些主要目录:
1、数据库目录 /var/lib/mysql/
2、配置文件 /usr/share/mysql(mysql.server命令及配置文件)
3、相关命令 /usr/bin (mysqladmin mysqldump等命令)
4、启动脚本 /etc/rc.d/init.d/(启动脚本文件mysql的目录)
安装后通过netstat –ano命令查看mysql默认端口3306是否存在,如果不存在,按下面的方法启动mysql服务。
启动mysql服务:
[root@localhostmysql]# pwd/usr/share/mysql[root@localhostmysql]# ./mysql.server startStartingMySQL...[ 确定 ][root@localhostmysql]# netstat -anoActiveInternet connections (servers and established)ProtoRecv-Q Send-Q Local Address Foreign Address State Timertcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN off (0.00/0/0)[root@localhostmysql]# mysqlWelcometo the MySQL monitor. Commands end with; or /g.YourMySQL connection id is 1Serverversion: 5.5.28 MySQL Community Server (GPL)Copyright(c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.Oracle isa registered trademark of Oracle Corporation and/or itsaffiliates.Other names may be trademarks of their respectiveowners.Type'help;' or '/h' for help. Type '/c' to clear the current input statement.mysql>mysql>
启动与停止
1、启动
MySQL安装完成后启动文件mysql在/etc/init.d目录下,在需要启动时运行下面命令即可。
[root@localhost mysql]# /etc/init.d/mysql start
2、停止
[root@localhost mysql] # /usr/bin/mysqladmin -u root -p shutdown
3、自动启动
1)察看mysql是否在自动启动列表中
[root@localhost mysql] # /sbin/chkconfig –list
2)把MySQL添加到你系统的启动服务组里面去
[root@localhost mysql] # /sbin/chkconfig – add mysql
3)把MySQL从启动服务组里面删除。
[root@localhost mysql] # /sbin/chkconfig – del mysqlbitsCN.com

方法:1、利用“select*from user_indexes where table_name=表名”语句查询表中索引;2、利用“select*from all_indexes where table_name=表名”语句查询所有索引。

oracle asm指的是“自动存储管理”,是一种卷管理器,可自动管理磁盘组并提供有效的数据冗余功能;它是做为单独的Oracle实例实施和部署。asm的优势:1、配置简单、可最大化推动数据库合并的存储资源利用;2、支持BIGFILE文件等。

在oracle中,可以利用“TO_SINGLE_BYTE(String)”将全角转换为半角;“TO_SINGLE_BYTE”函数可以将参数中所有多字节字符都替换为等价的单字节字符,只有当数据库字符集同时包含多字节和单字节字符的时候有效。

在Oracle中,可利用lsnrctl命令查询端口号,该命令是Oracle的监听命令;在启动、关闭或重启oracle监听器之前可使用该命令检查oracle监听器的状态,语法为“lsnrctl status”,结果PORT后的内容就是端口号。

方法:1、利用“LOWER(字段值)”将字段转为小写,或者利用“UPPER(字段值)”将字段转为大写;2、利用“REGEXP_LIKE(字符串,正则表达式,'i')”,当参数设置为“i”时,说明进行匹配不区分大小写。

在oracle中,可以利用“drop sequence sequence名”来删除sequence;sequence是自动增加数字序列的意思,也就是序列号,序列号自动增加不能重置,因此需要利用drop sequence语句来删除序列。

在oracle中,可以利用“select ... From all_tab_columns where table_name=upper('表名') AND owner=upper('数据库登录用户名');”语句查询数据库表的数据类型。

方法:1、利用“alter system set sessions=修改后的数值 scope=spfile”语句修改session参数;2、修改参数之后利用“shutdown immediate – startup”语句重启服务器即可生效。


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Chinese version
Chinese version, very easy to use

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Zend Studio 13.0.1
Powerful PHP integrated development environment

SublimeText3 Mac version
God-level code editing software (SublimeText3)

WebStorm Mac version
Useful JavaScript development tools