How to create a database from shell command?

前端 未结 8 1708
难免孤独
难免孤独 2021-01-29 17:24

I\'m looking for something like createdb in PostgreSQL or any other solution that would allow me to create database with a help of a shell command. Any hints?

8条回答
  •  醉梦人生
    2021-01-29 18:06

    Use

    $ mysqladmin -u  -p create 
    

    You will be prompted for password. Also make sure the mysql user you use has privileges to create database.

提交回复
热议问题