标签:长度 sql targe key use using localhost outer oca
http://dev.mysql.com/doc/mysql-yum-repo-quick-guide/en/
下载到本地再上传到服务器,或者使用wget 直接下载
wget http://repo.mysql.com/mysql57-community-release-el7-10.noarch.rpm
将platform-and-version-specific-package-name
替换为你下载的rpm名
sudo rpm -Uvh platform-and-version-specific-package-name.rpm
例如
rpm -Uvh mysql57-community-release-el7-10.noarch.rpm
yum install -y mysql-community-server
service mysqld start
重启是restart,
systemctl start mysqld.service
service mysqld status
systemctl status mysqld.service(也是系统自动输出的,我这边全称是:Redirecting to /bin/systemctl status mysqld.service)
grep ‘temporary password‘ /var/log/mysqld.log(如果之前安装过MySQL则这里可能会有多个密码,用最后一个,注意这个密码输入时是可以粘贴的)
使用默认的密码登陆
mysql -uroot -p(这是一个MySQL的以密码登录root用户的命令)
用该密码登录到服务端后,必须马上修改密码再执行一些数据库操作,不然会报如下错误:
mysql> select @@log_error;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql>
修改密码(注意,登录后的操作后面都最好要有;结尾)
ALTER USER ‘root‘@‘localhost‘ IDENTIFIED BY ‘root‘;
如果密码设置太简单出现以下的提示
必须修改两个全局参数:
首先,修改validate_password_policy参数的值
mysql> set global validate_password_policy=0;
再修改密码的长度
set global validate_password_length=1;
再次执行修改密码就可以了
ALTER USER ‘root‘@‘localhost‘ IDENTIFIED BY ‘root‘;(ALTER等可以写成小写)
GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘mima‘ WITH GRANT OPTION;
FLUSH PRIVILEGES;
标签:长度 sql targe key use using localhost outer oca
原文地址:https://www.cnblogs.com/5aiQ/p/9471066.html