简体   繁体   中英

Importing a mysql database with command line

Have tried all other answers on stackoverflow, and they haven't worked. I have a database in phpMyAdmin, and I need to update it. The file is too big to upload via phpMyAdmin, and I've tried increasing limits in php.ini to no avail. I think that didn't work because I updated php.ini in public_html, and phpMyAdmin gets it memory/upload limits from the global file.

Anyhow, people recommend command line, so this is what I tried:

# mysql -u db_username -p db_pw -h localhost  existing_empty_db_name < new_db.sql 

Then it just gives me a huge list of mysql options, and does nothing else. I refresh the db in phpMyAdmin, and nothing has changed. What am I missing?

You are missing the -D option here. Correct syntax would be:

mysql -u db_username -p db_pw -h localhost -D existing_empty_db_name < new_db.sql 

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