标签:改密码 serve rman 策略 路径 connect ora init val
官网查看最新 MySQL 安装包
https://dev.mysql.com/downloads/repo/yum/
下载 MySQL 源的安装包
wget http://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
安装 MySql 源
yum -y install mysql57-community-release-el7-11.noarch.rpm
查看一下安装效果
yum repolist enabled | grep mysql.*
yum 安装 mysql 启动 MySQL 服务
安装 mysql:
yum -y install mysql-server
启动 MySQL
systemctl start mysqld
查看 MySQL 的启动状态
systemctl status mysqld
配置 MySQL 服务开机启动
systemctl enable mysqld
配置 MySQL 服密码策略
策略 检查规则 0 or LOW Length 1 or MEDIUM Length; numeric, lowercase/uppercase, and special characters 2 or STRONG Length; numeric, lowercase/uppercase, and special characters; dictionary file MySQL 官网密码策略详细说明:
validate_password_policy=0
my.cnf 文件中添加如下配置禁用即可:
validate_password = off
mysql 服务使配置生效:
systemctl restart mysqld
修改 MySQL root 本地登录密码
grep ‘temporary password‘ /var/log/mysqld.log
mysql -u root -p
ALTER USER ‘root‘@‘localhost‘ IDENTIFIED BY ‘new password in here‘;
或
set password for ‘root‘@‘localhost‘=password(‘new password in here‘!‘);
通过 msyql 环境变量可以查看密码策略的相关信息:
mysql> show variables like ‘%password%‘;
mysql -u root -p mysql> use mysql; mysql> update user set host = ‘%‘ where user = ‘root‘;
mysql> select host, user from user;
firewall-cmd --zone=public --add-port=3306/tcp --permanent
重新载入:
firewall-cmd --reload
查看
查看所有打开的端口: firewall-cmd --zone=public --list-ports
删除
firewall-cmd --zone= public --remove-port=3306/tcp --permanent
[mysqld] character_set_server=utf8 init_connect=‘SET NAMES utf8’
systemctl restart mysqld
mysql> show variables like ‘%character%‘;
ERROR 1396 (HY000): Operation ALTER USER failed for ‘root‘@‘localhost‘
解决如下:
先登录mysql
mysql -u root -p
输入密码
mysql> use mysql;
mysql> select user,host from user;
注意我的root,host是‘%‘
你可能执行的是:
ALTER USER ‘root‘@‘localhost‘ IDENTIFIED WITH mysql_native_password BY ‘123‘;
改成:
ALTER USER ‘root‘@‘%‘ IDENTIFIED WITH mysql_native_password BY ‘123‘;
配置文件:/etc/my.cnf
日志文件:/var/log//var/log/mysqld.log
服务启动脚本:/usr/lib/systemd/system/mysqld.service socket
文件:/var/run/mysqld/mysqld.pid
登陆mysql,输入
1、编辑/etc/my.cnf文件
vi /etc/my.cnf
2、添加port=2032;
3、重启mysql
Linux_CentOS中的MySQL 数据库的安装调试、远程管理
标签:改密码 serve rman 策略 路径 connect ora init val
原文地址:https://www.cnblogs.com/loaderman/p/11653840.html