(1) PostgreSQL:
创建用户 xxxx1,密码 xxxx,创建数据库 xxxx2,赋予 xxxx1 在 xxxx2 上的所有权限。

# sudo --u postgres
$ psql
postgres# 
CREATE USER xxxx1 WITH PASSWORD 'xxxx';
postgres# 
CREATE DATABASE xxxx2;
postgres# 
GRANT ALL PRIVILEGES ON DATABASE xxxx2 to xxxx1;

(2) MySQL
创建用户 xxxx1,密码 xxxx,创建数据库 xxxx2,赋予 xxxx1 在 xxxx2 上的所有权限。

# cd /usr/local/mysql/bin
# ./mysql -u root -h localhost -p

mysql> CREATE USER xxxx1@'localhost' IDENTIFIED BY 'xxxx';
mysql> CREATE DATABASE xxxx2;
mysql> GRANT ALL PRIVILEGES ON xxxx2.* TO xxxx1@'localhost'

(3) MySQL 的启动和关闭

# cd /usr/local/mysql
# bin/mysqld_safe --user=mysql &
# bin/mysqladmin -u root -h localhost -p shutdown

 

 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-14
  • 2021-06-21
  • 2022-02-28
  • 2022-12-23
猜你喜欢
  • 2021-12-25
  • 2021-11-19
  • 2022-12-23
  • 2022-03-06
  • 2022-02-22
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案