0

phpfogでWordPressサイトを作成し、gitを使用してローカルにダウンロードしました。phpfogの設定方法ワードプレスデータベースにアクセスして、ローカルホストのインストールからアクセスすることはできません。別のデータベースを設定する必要があります。これまでのところ、私はそれを機能させることができていません。Phpmyadminは開きません。(Wordpressの新規インストールも試しましたが、同じことが起こります)

問題はデータベースが必要なことだと思います。しかし、どこに置くのですか?どのディレクトリですか?

これが私が今いるところです:

wp-config.phpファイルで、myliniのパラメーター「user」を「root」に変更し、パスワードを「mypassword」に変更しました。パスワードパラメーターを「mypassword」に変更し、ポートを「3306」に変更しました。

config.inc.phpで、「user」を「root」に、「password」を「」に変更しました。

phpmyadminに接続しようとすると、これが表示されます。

Error
MySQL said:

Cannot connect: invalid settings.
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.

私はさまざまなフォーラムでいくつかのアイデアを試しましたが、まだこれを乗り越えるものはありません。どんなアイデアも素晴らしいでしょう。

グレッグ

4

2 に答える 2

1

First - It's hard to know how to answer as your question is rather vague. There's two very different things involved. First, setting up xampp. Then setting up wordpress. I couldn't quite figure out which you were referring to for each error, so here's a long winded explination/answer in case any thing helps:

Are you on Linux I presume? On windows it was a bit of a hassle and wamp was 20x easier. But, you might consider a preconfigured stack that includes xampp (and necessary includes) and a few other goodies, some come with wordpress installed. I haven't personally used them, but wish I had - google ought to help out there.

I'm assuming you went to (http://)localhost/phpmyadmin, right?

First you need to get there before you hook up wordpress. As for hooking up xampp, it does take some configuration, so make sure you follow the docs - it's not quite a one click install.

Once you have xampp setup, you need to create a new database in localhost/phpmyadmin for wordpress. Then go back to your file folders, which should be located in xampp/htdocs/yourwordpressinstall.

config.inc.php - is that your wordpress directory? It needs to be wp-config.php (if it's not already there, save wp-config-sample.php as such). Open that, change server to localhost, database to the name of the database you just created. The username and password are the ones when you installed xampp. By default, I think they're User: Root, and PW: unset(blank). If you go to phpmyadmin there's a link to security and it'll show you there. localhost/phpmyadmin

Now, you should be able to type in the location of the filefolders.

localhost/wordpress/ - assuming your server is started, and the wordpress root folder is name "wordpress" and is in the xampp/htdocs/ folder.

From there you should see wordpress.

However, if you've exported your database, you'll need to change the site_url and home_url options to the new url. I'd suggest using the plugin wp db migrate (something like that) which will allow you to export the database from wordpress and auto set the values. Once the plugin is installed it's under the tools menu.

If you google migrating wordpress, you'll find plenty of tutorials and guides for moving wordpress from local to live, or as you're doing, online to local.

Sorry, I have to run, so I'm not sure if I really got to exactly what you needed, but that should get you started and give you the keywords to let google and other tutorials/docs get you the rest of the way.

于 2012-09-24T02:10:39.867 に答える
0

ローカルで開発することをお勧めします。つまり、ダミーデータベースを使用して自分のマシンで開発を行います。変更に満足したら、実際の(本番)データベースで動作するサーバーに変更をアップロードします

ローカルコピーをデータベースに接続するには:

  1. MySQLをローカルマシンにインストールします
  2. MySQLへのインターフェースを開きます。UNIXライクなシステムではmysql、コマンドラインで入力できます
  3. CREATE DATABASE ''databasename'';
  4. GRANT ALL PRIVILEGES ON ''databasename''.* TO "''username''"@"''hostname''" IDENTIFIED BY "''password''";(ホスト名が%の場合、すべてのホストからログインできます)
  5. FLUSH PRIVILEGES;
  6. ローカルのwp-config.phpをローカルのクレデンシャルとデータベース名で更新します
于 2012-09-24T01:35:36.250 に答える