时间:2021-07-01 10:21:17 帮助过:16人阅读
利用shell运行mysql语句,快速而方便地创建MySQL用户和数据库。
下面给出创建语句,其中美元符号表示命令提示符:
$ mysql -u adminusername -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5340 to server version: 3.23.54 Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the buffer. mysql> CREATE DATABASE databasename; Query OK, 1 row affected (0.00 sec) mysql> GRANT ALL PRIVILEGES ON databasename.* TO "wordpressusername"@"hostname" IDENTIFIED BY "password"; Query OK, 0 rows affected (0.00 sec) mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.01 sec) mysql> EXIT Bye $
Mysql快速创建数据库和用户
标签:mysql用户 运行 符号 3.5 query username server 创建数据库 monitor