简体   繁体   中英

Importing a database into mysql localhost using wamp server

This may sound like an extremely stupid question but I have no idea how to do this?

I'm running putty on my windows machine and i know if i wanted to import a database to a remote website i would just fire up putty and enter the host name and my username and password. Login to ssh and then create the database and then import the database like so: mysql production < production_2015.sql

What i don't understand is how to i ssh into my localhost which resides on my computer. I have phpMyAdmin and i could choose to continue to do the uploads like that but just like everything in phpMyAdmin it has major latency issues.

I feel dumb for asking this question but here's things i've tried. Opening putty and adding localhost where the host name goes. I've also tried to add the IP 127.0.0.1 where the host/ip goes in putty. I constantly just get a network error or connection refused. At this point i'm not even sure if this is how you would do it or not. I feel like this is a super easy question but i can't wrap my brain around the answer.

Here is my phpMyAdmin config.inc file:

$i++;
/* Authentication type */
$cfg['Servers'][$i]['verbose'] = 'mysql wampserver';
//$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'me';
/* Server parameters */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;

Any help would be greatly appreciated.

Depending on your path, it would be something like this:

C:\xampp\mysql\bin\mysql.exe -u root -p production < production_2015.sql

There is more discussion in this question which might help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM