Ghost+MySQL 到底要怎么设置呢? 各位指点下 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Jays
V2EX    问与答

Ghost+MySQL 到底要怎么设置呢? 各位指点下

  •  
  •   Jays 2014-12-13 00:23:05 +08:00 3571 次点击
    这是一个创建于 4021 天前的主题,其中的信息可能已经有所发展或是发生改变。
    配置文件如下:

    // # Ghost Configuration
    // Setup your Ghost install for various environments
    // Documentation can be found at http://support.ghost.org/config/

    var path = require('path'),
    config;

    cOnfig= {
    // ### Production
    // When running Ghost in the wild, use the production environment
    // Configure your URL and mail settings here
    production: {
    url: 'http://localhost',
    mail: {},
    client: 'mysql',
    connection: {
    host : '127.0.0.1',
    user : 'root', //我们暂且用 MySQL 的 root 账户
    password : '111111', //输入你的 MySQL 密码
    database : 'ghost', //我们前面为 Ghost 创建的数据库名称
    charset : 'utf8'
    },
    debug: false
    },

    server: {
    // Host to be passed to node's `net.Server#listen()`
    host: '127.0.0.1',
    // Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT`
    port: '2368'
    }
    },

    // ### Development **(default)**
    development: {
    // The url to use when providing links to the site, E.g. in RSS and email.
    // Change this to your Ghost blogs published URL.
    url: 'http://localhost:2368',

    // Example mail config
    // Visit http://support.ghost.org/mail for instructions
    // ```
    // mail: {
    // transport: 'SMTP',
    // options: {
    // service: 'Mailgun',
    // auth: {
    // user: '', // mailgun username
    // pass: '' // mailgun password
    // }
    // }
    // },
    // ```

    database: {
    client: 'mysql',
    connection: {
    host : '127.0.0.1',
    user : 'root', //我们暂且用 MySQL 的 root 账户
    password : '111111', //输入你的 MySQL 密码
    database : 'ghost', //我们前面为 Ghost 创建的数据库名称
    charset : 'utf8'
    },
    debug: false
    },
    server: {
    // Host to be passed to node's `net.Server#listen()`
    host: '127.0.0.1',
    // Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT`
    port: '2368'
    },
    paths: {
    contentPath: path.join(__dirname, '/content/')
    }
    },

    // **Developers only need to edit below here**

    // ### Testing
    // Used when developing Ghost to run tests and check the health of Ghost
    // Uses a different port number
    testing: {
    url: 'http://127.0.0.1:2369',
    database: {
    client: 'sqlite3',
    connection: {
    filename: path.join(__dirname, '/content/data/ghost-test.db')
    }
    },
    server: {
    host: '127.0.0.1',
    port: '2369'
    },
    logging: false
    },

    // ### Testing MySQL
    // Used by Travis - Automated testing run through GitHub
    'testing-mysql': {
    url: 'http://127.0.0.1:2369',
    database: {
    client: 'mysql',
    connection: {
    host : '127.0.0.1',
    user : 'root',
    password : '',
    database : 'ghost_testing',
    charset : 'utf8'
    }
    },
    server: {
    host: '127.0.0.1',
    port: '2369'
    },
    logging: false
    },

    // ### Testing pg
    // Used by Travis - Automated testing run through GitHub
    'testing-pg': {
    url: 'http://127.0.0.1:2369',
    database: {
    client: 'pg',
    connection: {
    host : '127.0.0.1',
    user : 'postgres',
    password : '',
    database : 'ghost_testing',
    charset : 'utf8'
    }
    },
    server: {
    host: '127.0.0.1',
    port: '2369'
    },
    logging: false
    }
    };

    // Export config
    module.exports = config;



    npm start 后提示

    > [email protected] start /www/web/ghost
    > node index

    ERROR: Ghost is unable to start due to missing dependencies:
    Cannot find module 'bcryptjs'
    Cannot find module 'bluebird'
    Cannot find module 'body-parser'
    Cannot find module 'bookshelf'
    Cannot find module 'busboy'
    Cannot find module 'cheerio'
    Cannot find module 'colors'
    Cannot find module 'compression'
    Cannot find module 'connect-slashes'
    Cannot find module 'downsize'
    Cannot find module 'express'
    Cannot find module 'express-hbs'
    Cannot find module 'fs-extra'
    Cannot find module 'html-to-text'
    Cannot find module 'knex'
    Cannot find module 'lodash'
    Cannot find module 'moment'
    Cannot find module 'morgan'
    Cannot find module 'node-uuid'
    Cannot find module 'nodemailer'
    Cannot find module 'oauth2orize'
    Cannot find module 'passport'
    Cannot find module 'passport-http-bearer'
    Cannot find module 'passport-oauth2-client-password'
    Cannot find module 'request'
    Cannot find module 'rss'
    Cannot find module 'semver'
    Cannot find module 'showdown-ghost'
    Cannot find module 'sqlite3'
    Cannot find module 'unidecode'
    Cannot find module 'validator'
    Cannot find module 'xml'
    Cannot find module 'qiniu'
    Cannot find module 'upyun'
    Cannot find module 'aliyun-sdk'

    Please run `npm install --production` and try starting Ghost again.
    Help and documentation can be found at http://support.ghost.org.


    npm install --production 运行后还是使用SQLite3
    2 条回复    2014-12-13 09:59:40 +08:00
    Lesilva
        1
    Lesilva  
       2014-12-13 06:03:14 +08:00
    database: {
    client: 'mysql',
    connection: {
    host : '127.0.0.1',
    user : 'your_database_user',
    password : 'your_database_password',
    database : 'ghost_db',
    charset : 'utf8'
    }
    }

    要改Production里面的 你改成Development的设置了
    Jays
        2
    Jays  
    OP
       2014-12-13 09:59:40 +08:00 via Android
    @Lesilva Production也是mysql的配置
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     3065 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 24ms UTC 12:43 PVG 20:43 LAX 04:43 JFK 07:43
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86