随笔分类 -  MySQL

摘要:编辑MySQL的配置文件/etc/my.cnf [mysqld] #增加一行 default-character-set=utf8 [client] #增加一行default-character-set=utf8 阅读全文
posted @ 2012-12-07 12:44 lhfly 阅读(224) 评论(0) 推荐(0) 编辑
摘要:/*建库:*/drop database if exists 数据库名;create database 数据库名;/*打开库*/use 数据库名; /*建表:*/drop table if exists 表名;/*================================*//* Table: tableName *//*================================*/create table imagesresources( Id bigint n... 阅读全文
posted @ 2012-12-06 11:27 lhfly 阅读(1600) 评论(0) 推荐(0) 编辑
摘要:1、安装Apache2 yum install httpd2、启动 方法一:service httpd start 方法二:/etc/init.d/httpd start//浏览http://ip,应该看到Apache2的测试页3、设置开机启动 方法一:chkconfig --levels 235 httpd on方法二:chkconfig httpd on//Apache的默认文档根目录是在CentOS上的/var/www/html 目录 ,配置文件是/etc/httpd/conf/httpd.conf。4、安装PHP5 yum install php //重启服务 方法一:service. 阅读全文
posted @ 2012-11-22 15:20 lhfly 阅读(6520) 评论(1) 推荐(0) 编辑
摘要:1、显示数据库 show databases;2、选择数据库use 数据库名;3、显示数据库中的表show tables;4、显示数据表的结构describe 表名;5、显示表中记录SELECT * FROM 表名6、建库 create databse 库名;7、建表create table 表名 (字段设定列表);mysql> create table name( -> id int auto_increment not null primary key , -> uname char(8), -> gender char(2), -> birthday dat 阅读全文
posted @ 2012-11-16 17:32 lhfly 阅读(125784) 评论(4) 推荐(6) 编辑
摘要:Centos 6.2 安装Mysql笔记1、安装命令# yum install mysql-server mysql2、查看是否安装正确# chkconfig --list mysqld3、启动(1)、启动服务:# service mysqld start(2)、停止服务:# mysqladmin -u root -p shutdown(3)、加入开机启动:# chkconfig mysqld on(4)、移除开机启: # chkconfig mysqld off(5)、查看服务是否正在运行:第一种方法:service --status-all | grep mysqld第二种方法:servi 阅读全文
posted @ 2012-11-15 15:20 lhfly 阅读(8005) 评论(0) 推荐(0) 编辑