7 centos 配置sudo权限_CentOS在线安装MySql5.7,并配置远程访问
1 安装命令wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpmyum localinstall mysql57-community-release-el7-8.noarch.rpmyum repolist enabled | grep "mysql.*-community.*"yum install...
·
1 安装命令
wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
yum localinstall mysql57-community-release-el7-8.noarch.rpm
yum repolist enabled | grep "mysql.*-community.*"
yum install mysql-community-server
systemctl start mysqld
systemctl enable mysqld
systemctl daemon-reloa`
2 修改root密码
cat /var/log/mysqld.log
cat /var/log/mysqld.log | grep temporar`
mysql -u root –p
#输入 找到的 初始密码
#修改初始密码
set password for 'root'@'localhost'=password('pass1234');
#如果提示不让修改密码, 是因为密码强度不符合默认的密码策略
#首先,修改validate_password_policy参数的值
set global validate_password_policy=0;
#再修改密码的长度
set global validate_password_length=1;
#再次执行修改密码就可以了
set password for 'root'@'localhost'=password('pass1234')`
3 允许其他主机远程登录
#授权其他机器登陆
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'pass1234' WITH GRANT OPTION;FLUSH PRIVILEGES;
#允许指定主机远程访问
set global validate_password_policy=0;
GRANT ALL PRIVILEGES ON aossdb.* TO 'root'@'192.168.0.1' IDENTIFIED BY 'pass1234' WITH GRANT OPTION;
4 mysql控制台远程登录
mysql -h {IP} {端口} -u {用户名} -p{密码}
开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!
更多推荐
已为社区贡献2条内容
所有评论(0)