Linux 安装和初步配置 mysql
2022/2/3 2:14:10
本文主要是介绍Linux 安装和初步配置 mysql,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
- 安装
- centos 8
sudo dnf install mysql-server sudo systemctl start mysqld.service sudo systemctl enable mysqld.service sudo systemctl status mysqld.service mysqladmin -u root -p version
- opensuse
wget -c https://repo.mysql.com//mysql80-community-release-sl15-5.noarch.rpm rpm -ivh mysql80-community-release-sl15-5.noarch.rpm sudo rpm --import /etc/RPM-GPG-KEY-mysql sudo zypper ref mysql80-community sudo zypper install -y mysql-community-server # root 默认密码 在 /var/log/mysql/mysqld.log sudo systemctl enable mysql; sudo systemctl start mysql; sudo systemctl status mysql;
修改root密码,创建admin用户并允许远程登录,记得服务器防火墙的3306端口要打开
sudo mysql_secure_installation 根据提示修改root密码 mysql -u root -p #输入密码然后登录mysql
mysql> CREATE USER `admin`@`%` IDENTIFIED BY 'password'; mysql> GRANT ALL ON *.* TO `admin`@`%` WITH GRANT OPTION;
这篇关于Linux 安装和初步配置 mysql的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-11-04部署MySQL集群项目实战:新手入门教程
- 2024-11-04如何部署MySQL集群资料:新手入门指南
- 2024-11-02MySQL集群项目实战:新手入门指南
- 2024-11-02初学者指南:部署MySQL集群资料
- 2024-11-01部署MySQL集群教程:新手入门指南
- 2024-11-01如何部署MySQL集群:新手入门教程
- 2024-11-01部署MySQL集群学习:新手入门教程
- 2024-11-01部署MySQL集群入门:新手必读指南
- 2024-10-23BinLog入门:新手必读的MySQL二进制日志指南
- 2024-10-23Binlog入门:MySQL数据库的日志管理指南