Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
In phpmyadmin, we can drop a specific database from operation tab and by hitting "DROP THE DATABASE (DROP)". But I need to drop a specific database using command prompt or terminal.
Use mysqladmin like
mysqladmin -uroot -pyourpassword drop database_name
In this case User: root with password: yourpassword will delete database database_name
You will get a warning and have to verify it
You can try this
DROP DATABASE database;
https://dev.mysql.com/doc/refman/5.7/en/drop-database.html
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 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
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.