Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run a script on a database in command line (MySQL Server)

I have just installed MySQL Community Server and now want to create a database and then run a script on it in a command line.

I tried this one but looks like it doesn't work:

CREATE DATABASE admin_web_projektu
mysql admin_web_projektu < c:/USI-4/db_template_001.sql
like image 613
user1111261 Avatar asked Mar 19 '26 18:03

user1111261


1 Answers

use below steps:

  1. Create database yourdbname;

  2. use yourdbname;

  3. source path_to_DB_script;


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!