Copying an existing Magento site to run locally - magento

I am having a hard time running my Magento site website locally using xampp. I have downloaded everything in the public_html to the htdocs folder. It is giving me a n error when i load
SQLSTATE[HY000] [1045] Access denied for user 'mySite_magstore'#'localhost' (using password: YES)
I loaded up the phpmyadmin panel to check the password but it is not loading the one from my website but the new one i have locally. I'm sure I am missing a step here as well.
All the information I have found online is regarding setting up a new site on xampp but could not find anything about using an existing one. Any help or links would help.
Thanks!

If you want to create a test environment in your machine, try the following steps:
Export your live DB
Import it in your local machine
Go in to the core_config_data table and change the 'value' of:
web/unsecure/base_url
And:
web/secure/base_url
To:
http://127.0.0.1/
Go in to:
app/etc/local.xml
And change the username and password to the correct ones
Edit:
Thanks to Cooper Maruyana for bringining this up:
If the previous step doesn't help delete everything in the 'var' folder.

Check your app\etc\local.xml for below line
<password><![CDATA[]]></password>
I am sure you have set some password for production server, but on your local you don't have any password for your root user. So you need to remove that password and also set you base URL in core_config table.

There are two possible options: one is to copy your database from your server to your localhost as pzirkind has illustrated in his answer.
The second option in case you want to use exactly the same database, i.e. you WANT to use your live database:
You need to adjust your app/etc/local.xml file to point to the database server IP address. Currently there should be "localhost" in there. Remove that and put the database server IP address. If you have setup the user on the database to allow remote access (% for scope in phpmyadmin), then this would work, too.
However, I would not recommend this option. I only use it sometimes to share a database between development and staging areas, but never for live sites.
Therefore, I would highly recommend pzirkind's approach!

Related

How to move Locally developed Prestashop to hosting server

I have installed Prestashop 1.7 with MariaDB, in local system it is working fine. I have developed 4 different pages. I want to move this pages to hosting server? Do i need to install the same Prestashop version in the hosting server or just copy and paste will work?. I developed in Ubuntu 16.04 system. Do i need do some changes in db developed in local system while moving to hosting server?
You should simply follow this process:
Transfer your files through FTP to your hosting server
Transfer your database through phpMyAdmin to your hosting server (make use to use utf8_general_ci as a charset)
Upon transfer completion, edit /config/settings.inc.php to set the right MySQL password (the one provided by your hosting provider)
In your PrestaShop admin-panel, configure your main shop URL as well as if you want to use SSL (recommended) or not
Voilà!
After all setting Also You need to Change in ps_configuration table of DB.
In the name column, find the PS_SHOP_DOMAIN and PS_SHOP_DOMAIN_SSL row In the value column and write new domain name that you want PrestaShop to use.

how to run php artisan migrate from within my virtual machine

I've just started with Laravel, installed on WAMP server, and when trying to migrate the first tables, I get and error saying that homeasted#localhost user has no premission, but I dont know how to change it to work on my virtual machine. What should I do?
Please check out Laravels Homestead – it is easy to setup and provides you with a webserver, ready to use and pre-configured for Laravel.
But if you want to use WAMP, you have to:
1) Create a database for your new Laravel installation. Go to your local phpmyadmin, which comes pre-installed with WAMP Server. Login to your database (default username should be 'root', password is blank). There you can manage your databases. Go ahead and create one for your Laravel installation. (There are many tutorials about how to create a database with phpmyadmin)
2) Go to the root directory of your Laravel installation. Open the file called .env.example and fill in your database settings. Then save it to .env. This should get your database connection up and running. Read more about .env in the laravel docs.
If you're using Homestead, you do not need WAMP server. To run migrate command, you need to run vagrant up to start the VM box and then run vagrant ssh command to run SSH. Only after that you should run php artisan migrate command.
Please check here i think that can help you.
https://laracasts.com/discuss/channels/general-discussion/homestead-db-connection-problem
well you can change the table name in .env file which is present in the root directory
If it is not present in there (as it is not available in laravel 5.2) please download it.
Enjoy

Why magento installation hangs on configuration phase?

I am installing a fresh magento in my Windows 7 computer. I have Xampp installed. While installing magento, I had a problem at the configuration step where I had to fill database host, username, password etc. When I click continue after filling the required fields, the installation process doesn’t move forward. I am redirected to the same page.
Which Magento version your trying to instal? Try Magneto version 1.8.1 or higher. before installing run Magento check to test whether your server meets Magento requirements. here is the link for Checking system requirements for Magento
www.example.com:443:0 server certificate does NOT include an ID which matches the server name
Invalid Security Certificate, though it sounds like the HTTP server's starting anyway, just warning of the domain name mismatch. SSL isn't needed for installation though.
Are you using localhost or 127.0.0.1 for the host name?
Magento expects dots in the host name as it expects either a Fully Qualified Domain Name or an IP address, so if you didn't put a domain name in your computer's hosts files to resolve to, you need to use an IP address.
The other thing to consider is making sure you've set up the database on MySQL and have connected to it by other means to make sure your database login credentials actually work and that you have permissions to write to the database.
I have this problem and it solve by tick this option in db configuration:
-Skip Base URL Validation Before the Next Step

How does Codeigniter know where mysql server is located?

I know this is a very newbie question. So supposed we have a wamp server installed, and downloaded codeigniter. Does the codeigniter find the mysql application through the environmental variable path like it shows on the phpinfo() page? If possible, could you tell me where I can see this configuration within the codeigniter application. The database.php file doesn't seem to have mysql path.
You have to define mysql credentials within application/config/database.php, so codeigniter can connect to your database.
To connect no path is required, instead you have to provide host, username and password.
In your case:
host: localhost
username: root
password: your default root password
Read here: https://ellislab.com/codeigniter/user-guide/database/configuration.html
In general, MySQL server is to install as a Windows Service (Daemon on linux), it can be controlled from the command line, or with the graphical services utility.
PHP interacts with MySQL by connecting to it using TCP/IP. So needless, we have to provide
credentials like hostname, port(default 3306), username ,password etc in order to connect with it. More details can be found here.

How to prevent running program on Win or Unix via command line

After a long research here on Stackoverflow and on net I didn't found nothing talking about it. As the title say, how can I do that?
For example: I am owner of a hosted website that allow me to manage the database via PhpMyAdmin. When I try to connect to my database via prompt, the connection never go fine. It could be because of OS settings (right?).
How can I do that (in both OSs).
Thanks in advance.
If I understand your question correctly:
You have a website with a MySql database hosted on your providers servers.
When you try to use your local PC installation of MySql from a command prompt, it will not let you connect.
I use dreamhost.com and have a similar setup. If I want to use database tools from my local PC to connect to the database, I have to enter my IP address in the db configuration page under "allowed hosts".
Restricting remote database connections to specific IP addresses protects your database from random hacking attempts.
As for your question about restricting command line execution of a program, that is usually just caused by missing configuration information in the environment variables - leaving the path to the executable out of the PATH variable is a common one. You would still be able to run the program if you enter the full path to it.
It really depends on the error message you get when trying to run the program from the command line.

Resources