Creating a MySQL database using a .SQL file

I don't know anything about MySQL at all. But I'm trying to rebuild a MySQL database using Visio. I know what steps I must take to do this, but I cannot get my database to appear in the Databases section (as shown below):

enter image description here

How to create a MySQL database using a .SQL file and get it in this list? I tried this code: mysql -u username -p password database_name <filename.sql using my own credentials, of course. But that does not work. In which folder should the .SQL file be placed if this expression should work?

+5
source share
2 answers

1) Create the file "filename.sql"

2) , .

3) / , "filename.sql".

4) : mysql -u username -p password database_name < filename.sql. ( ). , MySQL. , mysql -u username database_name < filename.sql .

, ojs, ojs.sql C: drive :

: .

mysql -u username -p password ojs < "C:\ojs.sql"

mysql. :

1)

2) "use ojs;"

3) "source C:/ojs.sql"

+24

MySQL SQL , , " ", , :

  • mysql -u [username] -p[password]

(. , ('') -p [password]. MySQL , [] - , . "" () , - .)

  • ( )

    mysql> source [database_creation_file].sql

+10

All Articles