參考文章:
https://www.howtoing.com/how-to-install-mariadb-on-debian-9
https://blog.gtwang.org/linux/mysql-create-database-add-user-table-tutorial/
1.sudo apt install mariadb-server
2.sudo mysql_secure_installation
3.GRANT ALL ON *.* TO 'admin'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
4.mysql -u admin -p
輸入密碼
# 新增資料庫
CREATE DATABASE `my_db`;
# 新增使用者,設定密碼
CREATE USER 'my_user'@'localhost' IDENTIFIED BY 'my_password';
# 設定使用者權限
GRANT ALL PRIVILEGES ON my_db.* TO 'my_user'@'localhost';
沒有留言:
張貼留言