dnf update
dnf -y install libaio ncurses-compat-libs perl net-tools tar
curl -OL https://downloads.mysql.com/archives/get/p/23/file/MySQL-5.6.51-1.el7.x86_64.rpm-bundle.tar
tar -xvf ySQL-5.6.51-1.el7.x86_64.rpm-bundle.tar
rpm -i MySQL-server-5.6.51-1.el7.x86_64.rpm
rpm -i MySQL-client-5.6.51-1.el7.x86_64.rpm
2.安装完成后的提示信息截图
A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER !
You will find that password in '/root/.mysql_secret'.
You must change that password on your first connect,
no other statement but 'SET PASSWORD' will be accepted.
See the manual for the semantics of the 'password expired' flag.
Also, the account for the anonymous user has been removed.
In addition, you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test database.
This is strongly recommended for production servers.
See the manual for more instructions.
Please report any problems at http://bugs.mysql.com/
The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
New default config file was created as /usr/my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings
3.修改密码
[root@Rocky abc]# cat /root/.mysql_secret
# The random password set for the root user at Sun Nov 21 16:13:49 2021 (local time): gJqxxYclIrlDN9c1
# 启动mysql并设定为开机自启动
chmod -R 0777 /var/lib/mysql # 要赋予这个文件夹内root运行的权限,否则会报错!!
systemctl start mysql
systemctl status mysql
systemctl enable mysql
#修改密码
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)