dzhai

再牛逼的梦想,也抵不住傻逼似得坚持


  • 首页

  • 归档

  • 分类

  • 标签

  • 关于

  • 搜索

ConOS6.5 从MySQL官方Yum仓库安装MySQL5.6

发表于 2014-10-17   |   分类于 环境配置   |     |   阅读次数 0

###下载Yum仓库文件
点击链接No thanks, just start my download直接下载

安装Mysql

下载完成后将Yum库导入到你的本地:

sudo yum localinstall mysql-community-release-el6-*.noarch.rpm

这个Yum库包含了MySQLServer,MySQL工作台管理工具以及ODBC驱动,现在可以通过下面的命令简单地安装MySQLServer:

sudo yum install mysql-community-server

修改配置

mysql的几个重要目录

数据库目录
/var/lib/mysql/
配置文件
/usr/share/mysql(mysql.server命令及配置文件)
/etc/my.cnf
相关命令
/usr/bin(mysqladmin mysqldump等命令)
启动脚本
/etc/rc.d/init.d/(启动脚本文件mysql的目录)

centos彻底删除mysql

yum remove mysql mysql-server mysql-libs compat-mysql51
rm -rf /var/lib/mysql
rm /etc/my.cnf
查看是否还有mysql软件:
rpm -qa|grep mysql
有的话继续删除

LINUX下的MYSQL默认是要区分表名大小写,设置不区分大小写

1.用ROOT登录,修改/etc/my.cnf
2.在[mysqld]下加入一行:lower_case_table_names=1
3.重新启动数据库即可 sudo servcie mysqld restart

设置root 密码

update user set password = password (‘123456’) where user = “root”
Node:设置完密码后 直接使用 mysql 命令是进不去mysql 数据库的
要使用命令 mysql -u root -p

设置Mysql 开机启动

检查mysql 是否开机启动(如果2–5为on的状态就OK)
chkconfig –list mysqld
(mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off)
设置开机启动
chkconfig mysqld on
关闭开机启动
chkconfig mysqld off


###Link
Mysql Yum Repository
yun 命令
http://www.linuxidc.com/Linux/2014-06/103111.htm
http://361324767.blog.163.com/blog/static/11490252520124454042468/
https://www.centos.org/forums/viewtopic.php?t=2230
http://blog.163.com/yang_jianli/blog/static/1619900062012915115253789/
http://www.cnblogs.com/jifeng/archive/2010/08/29/1811879.html

阅读全文 »

心花路放

发表于 2014-10-11   |   分类于 电影   |     |   阅读次数 0

###心花路放/玩命邂逅电影/心花路放.2014
心花路放

1
2
3
4
5
6
7
又名:玩命邂逅 玩儿命邂逅 心花怒放 Breakup Buddies
标签:喜剧爱情

地区:中国大陆
年份:2014
导演:宁浩
编剧:岳小军邢爱娜孙小杭董润年章迪沙张艺凡
主演:黄渤徐峥袁泉周冬雨陶慧岳小军沈腾张俪马

百度网盘 http://pan.baidu.com/s/1kTC83xt 密码: neuq
BT天堂下载

阅读全文 »

install-mongodb-wondow7

发表于 2014-10-08   |   分类于 MongoDB   |     |   阅读次数 0

##Download MongoDB

There are three builds of MongoDB for Windows:

1) MongoDB for Windows Server 2008 R2 edition [Download link]

2) MongoDB for Windows 64-bit [Download link]

3) MongoDB for Windows 32-bit [Download link]

To find which version of Windows you are running, enter the following command in the Command Prompt:

c:\> wmic os get osarchitecture

More download options are given in official website of MongoDB.

##Install MongoDB

The given links above will download zip files which you extract directly onto any place in your system of your choice. I have extracted them in “d:/mongodb“. So, all code samples will in this post as well as future posts will refer to this location.

It’s recommended to add d:/mongodb/bin to Windows environment variable, so that you can access the MongoDB’s commands in command prompt directly.

Also, please create following directories inside d:/mongodb

  • D:\mongodb\data
  • D:\mongodb\log

##Create mongo.config Configuration File

This is important step before marching ahead. Create a normal text file in location d:/mongodb and save it with name mongo.config.

Now place the below configuration options in file. You can change the option’s values at your will.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
##Which IP address(es) mongod should bind to. 
bind_ip = 127.0.0.1

##Which port mongod should bind to.
port = 27017

##I set this to true, so that only critical events and errors are logged.
quiet = true

##store data here
dbpath=D:\mongodb\data

##The path to the log file to which mongod should write its log messages.
logpath=D:\mongodb\log\mongo.log

##I set this to true so that the log is not overwritten upon restart of mongod.
logappend = true

##log read and write operations
diaglog=3

##It ensures write durability and data consistency much as any journaling scheme would be expected to do.
##Only set this to false if you don’t really care about your data (or more so, the loss of it).
journal = true

##Start/Shutdown the MongoDB Server

To start the MongoDB server, use below command in command prompt:

mongod.exe –config d:\mongodb\mongo.config

1
2
3
4
D:\mongodb\bin>mongod --config D:\mongodb\mongo.config --journal
2014-05-25T16:51:18.433+0530 warning: --diaglog is deprecated and will be removed in a future release
2014-05-25T16:51:18.434+0530 diagLogging level=3
2014-05-25T16:51:18.435+0530 diagLogging using file D:\mongodb\data/diaglog.5381d22e

To connect to MongoDB from command prompt, use below command:

d:\mongodb\bin>mongo

1
2
3
4
5
6
7
8
9
10
11
12
13
14
D:\mongodb\bin>mongo
MongoDB shell version: 2.6.1
connecting to: test
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see http://docs.mongodb.org/
Questions? Try the support group http://groups.google.com/group/mongodb-user
Server has startup warnings:
2014-05-25T16:52:09.158+0530 [initandlisten]
2014-05-25T16:52:09.158+0530 [initandlisten] ** NOTE: This is a 32 bit MongoDB binary.
2014-05-25T16:52:09.158+0530 [initandlisten] ** 32 bit builds are limited to less than 2GB of data (or less with --jour
nal).
2014-05-25T16:52:09.158+0530 [initandlisten] ** See http://dochub.mongodb.org/core/32bit
2014-05-25T16:52:09.158+0530 [initandlisten]

To shutdown the MongoDB server, you must be authorized user. So after getting auth complete, use below command in command prompt:

db.shutdownServer()

1
2
3
4
5
6
7
8
9
10
11
12
13
> use admin
switched to db admin
> db.shutdownServer()
2014-05-25T19:55:25.221+0530 DBClientCursor::init call() failed
server should be down...
2014-05-25T19:55:25.224+0530 trying reconnect to 127.0.0.1:27017 (127.0.0.1) failed
2014-05-25T19:55:26.225+0530 warning: Failed to connect to 127.0.0.1:27017, reason: errno:10061 No connection could be made b
ecause the target machine actively refused it.
2014-05-25T19:55:26.225+0530 reconnect 127.0.0.1:27017 (127.0.0.1) failed failed couldn't connect to server 127.0.0.1:27017 (
127.0.0.1), connection attempt failed
> quit()

D:\mongodb\bin>

##MongoDB Windows Service

To install the window service, use below command:

mongod –config D:\mongodb\mongo.config –install

Start the windows service from command prompt:

net start MongoDB

Stop the windows service from command prompt:

net stop MongoDB

Remove the windows service

mongod –remove

Sample run of all above four commands is below:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
D:\mongodb\bin>mongod --config D:\mongodb\mongo.config --install
2014-05-25T20:07:41.191+0530 warning: --diaglog is deprecated and will be removed in a future release
2014-05-25T20:07:41.192+0530 diagLogging level=3
2014-05-25T20:07:41.193+0530 diagLogging using file D:\mongodb\data/diaglog.53820035

D:\mongodb\bin>net start MongoDB

The MongoDB service was started successfully.


D:\mongodb\bin>net stop MongoDB
System error 109 has occurred.

The pipe has been ended.


D:\mongodb\bin>mongod --remove
2014-05-25T20:09:32.514+0530
2014-05-25T20:09:32.515+0530 warning: 32-bit servers don't have journaling enabled by default. Please use --journal if you wa
nt durability.
2014-05-25T20:09:32.515+0530
2014-05-25T20:09:32.518+0530 Trying to remove Windows service 'MongoDB'
2014-05-25T20:09:32.520+0530 Service 'MongoDB' removed

D:\mongodb\bin>

##Download/Use MongoDB Java Driver

Download the MongoDB java driver (mongo-java-driver-2.9.3.jar) from this download link. It’s a jar file you need to include in your classpath/ copy in lib folder in project where you want to use MongoDB.

##Verify MongoDB Installation

To verify that MongoDB has been installed and working properly, execute below program:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package examples.mongodb.install;

import java.net.UnknownHostException;
import java.util.List;

import com.mongodb.MongoClient;

public class VerifyMongoDBInstallation {
public static void main(String[] args) throws UnknownHostException {
MongoClient mongo = new MongoClient("localhost", 27017);

List<String> dbs = mongo.getDatabaseNames();
for (String db : dbs) {
System.out.println(db);
}
}
}

Output:

local
admin

That’s all for MongoDB installation, startup and shutdown operations. Next, we will learn about some CRUD operations. Follow me to stay tuned.

Happy Learning !!

阅读全文 »

Hello World

发表于 2014-09-28   |     |   阅读次数 0

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in trobuleshooting or you can ask me on GitHub.

Quick Start test

Create a new post

1
$ hexo new "My New Post"

More info: Writing

Run server

1
$ hexo server

More info: Server

Generate static files

1
$ hexo generate

More info: Generating

Deploy to remote sites

1
$ hexo deploy

More info: Deployment

2048 数字游戏

发表于 2014-05-21   |   分类于 生活   |     |   阅读次数 0

这款数字小游戏只要细心就能发现其中的奥秘:
看图说明下
2048

  1. 大数在最角上图(3)的位置,不要让这一列移动,尽量把大数排放在这一列. 图(1)的位置,保证这一列4个空格都有数字,再做上下移动的操作,永远不要往右滑动.
  2. 必须保证这边的三列其中的一列可以上下移动。图(2)的位置,我操作的时候遇到过好几次这种情况,左边的三列都填满数字了,只能往右移动,造成大数移动,那么一般这种情况是玩不过得.
1…456
dzhai

dzhai

大翟

27 日志
16 分类
25 标签
RSS
GitHub 微博 知乎

友情链接

Cobaya
© 2014 - 2015 dzhai
由 Hexo 强力驱动
主题 - NexT.Pisces