//登陆root
#mysql -uroot -p
//change to user mysql database
mysql> use mysql;
//add user and password
mysql>create user 'show_building'@'localhost' identified by 'this is his password';
//create database
mysql>create database show_building;
//change the access right
mysql> grant all privileges on show_building.* to show_building@localhost identified by 'his passwd';
//flush
mysql> flush privileges;
//exit and re-login as the new user
# mysql -ushow_building -p
//show the database which linked to the user
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| show_building |
+--------------------+
2 rows in set (0.00 sec)
[mysql]增加用户,数据库,以及 把两者link起来
最新推荐文章于 2021-02-10 12:20:24 发布