Centos6.x installiert Mongodb und die Mongodb-PHP-Erweiterung
跳至
[1]
[全屏预览]
#mongodb 安装到/usr/local 目录 cd /usr/local #获取并下载最新稳定版本 https://www.mongodb.com/download-center?jmp=nav #百度云盘 http://pan.baidu.com/s/1i47YB0T wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.2.8.tgz tar zxvf mongodb-linux-x86_64-3.2.8.tgz mv mongodb-linux-x86_64-3.2.8 mongodb cd mongodb mkdir db mkdir logs cd bin #新建配置文件 vi mongodb.conf #复制下面的配置文件 dbpath=/usr/local/mongodb/db logpath=/usr/local/mongodb/logs/mongodb.log pidfilepath=/usr/local/mongodb/mongo.pid fork=true logappend=true shardsvr=true auth=true port=27017 nohttpinterface=true #结束 #重新绑定mongodb的配置文件地址和访问IP /usr/local/mongodb/bin/mongod --bind_ip localhost -f /usr/local/mongodb/bin/mongodb.conf #添加服务mongodb /usr/local/mongodb/bin/mongod show dbs #列出所有数据库 use admin #切换到admin数据库,添加的账号才是管理员账号。 show collections db.system.users.find() db.createUser({user:"root",pwd:"123456",roles:[{role:"root",db:"admin"}]}) #添加管理员账号:root 密码:123456 权限:有数据库admin的所有操作权限 db.auth('root','123456') #添加管理员用户认证,认证之后才能管理所有数据库 exit #退出 vi /etc/rc.d/init.d/mongod #设置开机启动MongoDB #!/bin/sh # chkconfig: - 64 36 # description:mongod case $1 in start) /usr/local/mongodb/bin/mongod --maxConns 20000 --config /usr/local/mongodb/bin/mongodb.conf ;; stop) /usr/local/mongodb/bin/mongo localhost:27017/admin --eval "db.auth('root', '123456');db.shutdownServer()" ;; status) /usr/local/mongodb/bin/mongo localhost:27017/admin --eval "db.auth('root', '123456');db.stats()" ;; esac chmod +x /etc/rc.d/init.d/mongod #添加脚本执行权限 chkconfig mongod on #设置开机启动 service mongod stop #关闭MongoDB service mongod start #启动MongoDB #重启一下系统测试下能不能自启 #进入mongodb的shell模式 /usr/local/mongodb/bin/mongo #查看数据库列表 show dbs #当前db版本 db.version(); #安装mongodb完成。 #开始安装 mongodb php扩展 #获取最新扩展插件 https://pecl.php.net/package/mongodb #下载最新版本 cd /www/wdlinux/php wget https://pecl.php.net/get/mongodb-1.1.8.tgz #解压 tar zxvf mongodb-1.1.8.tgz cd ./mongodb-1.1.8 /www/wdlinux/php/bin/phpize #编译 make #安装 make install #修改php.ini [mongodb] extension=mongodb.so #完成 访问 phpinfo.php <?php phpinfo(); ?>
Nach dem Login kopieren
2. [图片] mmm.png

Erklärung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn

Heiße KI -Werkzeuge

Undresser.AI Undress
KI-gestützte App zum Erstellen realistischer Aktfotos

AI Clothes Remover
Online-KI-Tool zum Entfernen von Kleidung aus Fotos.

Undress AI Tool
Ausziehbilder kostenlos

Clothoff.io
KI-Kleiderentferner

AI Hentai Generator
Erstellen Sie kostenlos Ai Hentai.

Heißer Artikel
R.E.P.O. Energiekristalle erklärten und was sie tun (gelber Kristall)
3 Wochen vor
By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Beste grafische Einstellungen
3 Wochen vor
By 尊渡假赌尊渡假赌尊渡假赌
Assassin's Creed Shadows: Seashell Riddle -Lösung
2 Wochen vor
By DDD
R.E.P.O. So reparieren Sie Audio, wenn Sie niemanden hören können
3 Wochen vor
By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: Wie man alles in Myrise freischaltet
3 Wochen vor
By 尊渡假赌尊渡假赌尊渡假赌

Heiße Werkzeuge

Notepad++7.3.1
Einfach zu bedienender und kostenloser Code-Editor

SublimeText3 chinesische Version
Chinesische Version, sehr einfach zu bedienen

Senden Sie Studio 13.0.1
Leistungsstarke integrierte PHP-Entwicklungsumgebung

Dreamweaver CS6
Visuelle Webentwicklungstools

SublimeText3 Mac-Version
Codebearbeitungssoftware auf Gottesniveau (SublimeText3)

Heiße Themen
CakePHP-Tutorial
1376
52

