Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
Hai I am trying to upload mysql database using putty i have tried few commands,
mysql -u {DB-USER-NAME} -p {DB-NAME} < /var/www/html/sample.sql
and tried
plink mysql -u username -p database_name < /var/www/html/sample.sql
but unable to upload files to linux server any suggetions
Try this syntax
mysql -u {DB-USER-NAME} -p --database={DB-NAME} < /var/www/html/sample.sql
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
How can i export database from workbench and import to phpmyadmin using dump file. ?
make sure you on root
Export Data syntax
mysqldump -u username -p database_name > data-dump.sql
Import DB
mysql -u root -p purchase_commerce < /opt/data-dump.sql
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I need to copy all the stored procedures from one schema to another programmatically with an SQL script.
How can I do this in MySQL? I don't want to have to run a PHP script.
Thank you
EDIT: I am on MySQL 8. Table mysql.proc doesn't exist. Also, the schemas are on the same server.
Dump the routines from one schema with mysqldump
https://dev.mysql.com/doc/refman/8.0/en/mysqldump-stored-programs.html
like
mysqldump --routines --no-create-info --no-data --no-create-db --skip-opt yourdb > yourdb.sql
and import into the new one
mysql -u root -p yournewdb < yourdb.sql
reference
select * from mysql.proc
to obtain wat you want.
Good work.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
I want to do the mysql-dump using perl script.Backup from some tables from mysql database in perl script.
system(mysqldump -u username -pPassword databasename database table > to /local path) or die..;
Tell me this line which will store backup file of tables to the local path.
Have you tried running that line from the command prompt? It looks like it should work. Are you putting the command in quotes?
system('mysqldump -u username -pPassword databasename database table > to /local path') or die('This failed');
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I need to export a table of size 3GB to another database. Both are on different server.
When i tried to export using phpmyadmin tool, It leads to server error.
Also both database are on different servers. I need to export and import into other server.
Please advise.
Use mysqldump if that is a possibility, archive it and copy it afterwards to the new server.
If mysqldump is not accessible, phpMyAdmin has a feature to export it already archived ... try with that.
MySQL provides a tool exactly for this purpose:
commandline_of_your_choice#> mysqldump -uusername -p -hlocalhost DB_Name --single-transaction | mysql -uusername -p -hremotehost DB_Name
Simple as that :)
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I am try to restore a big database from file using this command
source /path/to/database/file
it is return this error:
Failed to open file '/path/to/database/file', error: 27
the .sql file size 4.1G
If that's a file created by the mysqldump command, you'll probably want to run it using the mysql program. That'll be something like mysql -u <username> -p <databasename>
The mysqlimport command is another command you might wanna look at.