ubuntu 20.4 安装msyql+创建mysql用户

sudo apt-get update 
sudo apt-get upgrate
sudo apt install mysql-server

设置运行远程访问

修改:sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf

用# 注释掉bind-address = 127.0.0.1

进入mysql创建用户

mysql -u root -p
CREATE USER 'test'@'%' IDENTIFIED BY '12345678';
GRANT ALL PRIVILEGES ON *.* TO 'test'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;

退出mysql

systemctl restart mysql

 

posted @ 2023-05-27 11:48  lzy1666  阅读(86)  评论(0编辑  收藏  举报