I've got a live site, which I downloaded in order to be able to customize it more precisely by editing the code. I followed the steps of this tutorial.
What I've done so far:
Downloaded the files of my site.
Downloaded its database.
Created a new database (with the same name that is included in wp-config file).
Imported the downloaded database into the newly created one.
Edited the two entries according to step 5 in the tutorial and of course, added a new user with global privileges.
Edited the hosts file to have a custom domain.
Restarted Apache & MySQL (I use XAMPP).
Now it is still displaying the same error message, that a database connection could not be established.
There is "localhost" set up, but I am not able to use it, I can only connect to my offline sites by using 127.0.0.1.
I'd really appreciate your help.
Related
Unluckily I have deleted almost all users in XAMPP MySQL database. I have a wordpress sites working there, but I can't access phpmyadmin to edit database or even make a copy of it.
This is the error code:
New XAMPP security concept:
Access to the requested object is only available from the local network.
This setting can be configured in the file "httpd-xampp.conf".
I can't use MySQL to add new user...
How can I fix that? I only know that I have to add a new root account to access phpmyadmin from local network.
And for future - Do I need to remove some users when I transfer my website from XAMPP server to web server to make it safe? Or All the root users can't be reached from third person in the web?
Thanks for Your reply,
Peter
OKAY, after solving it for 4 hours I have made something better... I used Wordpress plugin "Duplicator" and just copied my website. Then I deleted XAMPP and installed it once more. I have imported my website and now it works fine - phpmyadmin too :)
I deleted database and db user of my WP website. My website stopped working.
I opened wpadmin.php and created database and user according to info in it.
Now when I try to open my website it redirects to
http://iiuischoolsryk.com/wp-admin/install.php
What should I do now? Should I proceed to Installation?
PS:
Although hosting provider is my best friend, he is not available to help
I have access to Cpanel, phpMYADMIN.
I have complete installation files of that particular wp theme.
All your previous data, unless backed up, is totally gone. You'll have your theme and plugins still in their directories, but no pages, posts, etc.
To get back to having a blank wordpress installation, do the following.
Create a new MySQL database, via phpMyAdmin if you like.
Create a new MySQL user, with password, and assign them permissions
to the database created in step 1.
Now run the 5 minute WordPress install with the database name, user
name, and passwordyou've just created.
Seen some other questions regarding this but not sure what I am doing wrong. Here is what I've done:
downloaded and unzipped a fresh install of wordpress to /Sites/wordpress
Started MAMP and set document root to above
Opened up phpmyadmin and created a new database named the same as the database I want to import. (I figured I did not need to change the url's in the older database because they will be the same on my computer? 'localhost/mysite')
Imported localhost1 database to newly created database
I know that user and password created are root, but I created an additional user and password to mimic what was in the wp-config of the original site (localhost1). I also changed localhost2's wp-config DB name, user, password to match that of localhost1 so that they are the same.
From this point I try and go to http://localhost:8888 or localhost/mysite but I basically get a 'This webpage is not available' screen as if I'm not online.
Any ideas?
This might have to do with variants serialized in the database even if the URL paths stay the same. Try taking the localhost1 database and migrating to localhost2 after using a serialization tool like this.
I realize you are not changing URL paths, however I've read that tables are all serialized so it's worth a try.
The problem in my opinion is not in the database, because WP will tell you if it is.
Problem must be in your local server configuration. In Windows I made different folder for different projects and access them like localhost/project1, localhost/project2 etc.
I don't know how are things in Mac, but must be the same. So try to start a fresh copy of WP in your new localhost, and then import database from first project.
When WP first starts creates .htaccess file with modrewrite, so you can also check current .htaccess file and rules there.
I inherited an old (version 1.4) Mediawiki installation. I'd like to update it, but have had a lot of trouble doing so.
I downloaded Mediawiki 1.19 and put it in a new directory. I put the old LocalSettings.php file in this new directory, altering only the $wgScriptPath variable to reflect the new directory name. I didn't alter the database name, user, or password.
When I try to run the update.php script, I get this:
DB connection error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) (localhost).
I've googled this pretty extensively. It's a common enough error, but most of the solutions involve cases where MySQL wasn't running in the first place or where something about the socket needs to be changed at a global level (i.e., for the whole site). Neither of these cases can apply, since there is a lot of other MySQL stuff going on with the site that is working fine.
On the off chance that something was wrong with the user credentials, I tried creating a completely new user and adding that user to LocalSettings.php, but I still get the same error.
Any tips would be greatly appreciated.
It seems that my initial download of Mediawiki 1.19 was somehow corrupt or incomplete. I re-downloaded the software and everything worked fine.
I have written a module that is refusing point blank to create the tables within my mysql4-install-1.0.0.php file....but only on the live server.
The funny thing is that on my local machine (which is a mirror of the live server (i.e. identical file structure etc)) the install runs correctly and the table is created.
So based on the fact that the files are the same can I assume that it is a server configuration and or permissions problem? I have looked everywhere and I can find no problems in any of the log files (PHP, MySQL, Apache, Magento).
I can create tables ok in test scripts (using core_read/write).
Anyone see this before?
Thanks
** EDIT ** One main difference between the 2 environments is that on the live server the MySQL is remote (not localhost). The dev server is localhost. Could that cause issues?
Is the module which your install script is a part of installed on the live server? (XML file in app/etc/modules/, Module List Module for debugging.)
Is there already a record in the core_resource table for your module? If so, remove it to set your script to re-run.
If you file named correctly? The _modifyResourceDb method in app/code/core/Mage/Core/Model/Resource/Setup.php is where this file is include/run from. Read more here
Probably a permissions issue - a MySQL account used by public-facing code should have as few permissions as possible that still let it get the job done, which generally does NOT allow for creating/altering/dropping tables.
Take whatever username you're connecting to mysql with, and do:
SELECT User, Host
FROM mysql.user
WHERE User='your username here';
This will show you the user#host combos available for that particular username, then you can get actual permissions with
show grants for username#host;
Do this for the two accounts on the live and devlopment server, which will show you what permissions are missing from the live system.
In the Admin->System->Advanced section is your module present and enabled?
Did you actually unpack your module to the right space, e.g. app/code/local/yourcompany/yourmodule ?
Do you have app/etc/modules/yourmodule.xml - I believe that this could be the overlooked file giving rise to your problem.
the cache could be the culprit, if you manually deleted the core_resource row for your module in order to make the setup sql run again, you have to also flush the cache
probably a difference between dev and production servers is cache settings, that would explain why you only see this in production
For me, the issue appeared using Windows for development. Linux system is case sensitive. In my config.xml the setup section was named camelCase while the folder was named all-lowercase. Making them the same made the script run.