1.安装数据库
wget https://repo.mysql.com//mysql80-community-release-el7-1.noarch.rpm
rpm -ivh mysql80-community-release-el7-1.noarch.rpm
yum install mysql-server
2. 启动数据库
systemctl start mysqld.service
3. 设置mysql
3.1 设置密码
grep "password" /var/log/mysqld.log
3.2 进入mysql,设置一个稍微复杂点密码
mysql -uroot -p
ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';
4.远程访问
4.1 控制台打开3306端口
4.2 修改 /etc/my.cnf文件,在[mysqld]底下加入
[mysqld]
default_authentication_plugin=mysql_native_password
lower_case_table_names=1
4.3 进入mysql
4.4 授权root用户可以远程登陆
update user set host='%' where user = 'root';
flush privileges;
标签:CentOs,安装,Mysql,community,mysqld,mysql,root,password,rpm
From: https://www.cnblogs.com/lwx11111/p/16950468.html