💝💝💝欢迎来到我的博客,很高兴能够在这里和您见面!希望您在这里可以感受到一份轻松愉快的氛围,不仅可以获得有趣的内容和知识,也可以畅所欲言、分享您的想法和见解。 推荐:kwan 的首页,
💝💝💝欢迎来到我的博客,很高兴能够在这里和您见面!希望您在这里可以感受到一份轻松愉快的氛围,不仅可以获得有趣的内容和知识,也可以畅所欲言、分享您的想法和见解。
非常期待和您一起在这个小小的网络世界里共同探索、学习和成长。💝💝💝 ✨✨ 欢迎订阅本专栏 ✨✨
rpm -qa | grep -i mysql
#查看mysql的状态systemctl status mysqld#关闭mysqlsystemctl stop mysqld
find / -name mysql
MySQL-server-5.6.22-1.el6.i686 为步骤 1 中查询到的数据项
rpm -ev MySQL-server-5.6.22-1.el6.i686rpm -ev MySQL-client-5.6.22-1.el6.i686
/etc/selinux/targeted/active/modules/100/mysql 为步骤 3 中查询到的文件
rm -rf /etc/selinux/targeted/active/modules/100/mysqlrm -rf /var/selinux/targeted/active/modules/100/mysqlrm -rf /var/lib/selinux/targeted/active/modules/100/mysqlrm -rf /var/lib/mysqlrm -rf /usr/lib/mysqlrm -rf /usr/share/bash-completion/completions/mysqlrm -rf /usr/share/selinux/targeted/default/active/modules/100/mysqlrm -rf /usr/local/mysql
#查询mariadbrpm -qa | grep mariadb#强制卸载rpm -e --nodeps 查询到的mariadb
下载 rpm 包时要认清对应的系统版本,el7 代表的是 Linux 7 版本,依次类推。
如何查看linux系统该下哪个包呢?
#查看系统cat /etc/redhat-releasecat /etc/os-releaseuname -acat /proc/version
Centos Linux release 7.x.x (Core)
#显示包含发行版cat /etc/redhat-release#显示包含各种系统信息cat /etc/os-release#显示系统信息uname -a#内核版本和编译信息cat /proc/version
这四个命令用于查看 Linux 系统的版本信息,但它们获取信息的方式和提供的详细信息略有不同:
cat /etc/redhat-release
:
cat /etc/os-release
:
uname -a
:
uname
命令用于显示系统信息,包括内核名称、主机名、内核发布版本等。-a
选项表示显示所有可用的信息。输出可能包括内核版本、系统架构等。cat /proc/version
:
uname
更详细的内核信息,包括编译日期、编译者等。综合来说,这些命令提供了有关系统版本和内核的不同方面的信息。选择使用其中一个取决于你关心的具体信息以及你正在使用的 Linux 发行版。
mysql-commUnity-common-8.0.35-1.el7.x86_64.rpmmysql-community-client-plugins-8.0.35-1.el7.x86_64.rpmmysql-community-libs-8.0.35-1.el7.x86_64.rpmmysql-community-libs-compat-8.0.35-1.el7.x86_64.rpmmysql-community-client-8.0.35-1.el7.x86_64.rpmmysql-community-icu-data-files-8.0.35-1.el7.x86_64.rpmmysql-community-server-8.0.35-1.el7.x86_64.rpm
将文件上传到服务器的/kwan/software/mysql 目录下
scp /Users/qinyingjie/Downloads/mysql/mysql-community-client-8.0.35-1.el7.x86_64.rpm root@43.139.90.182:/kwan/software/mysqlscp /Users/qinyingjie/Downloads/mysql/mysql-community-client-plugins-8.0.35-1.el7.x86_64.rpm root@43.139.90.182:/kwan/software/mysqlscp /Users/qinyingjie/Downloads/mysql/mysql-community-common-8.0.35-1.el7.x86_64.rpm root@43.139.90.182:/kwan/software/mysqlscp /Users/qinyingjie/Downloads/mysql/mysql-community-icu-data-files-8.0.35-1.el7.x86_64.rpm root@43.139.90.182:/kwan/software/mysqlscp /Users/qinyingjie/Downloads/mysql/mysql-community-libs-8.0.35-1.el7.x86_64.rpm root@43.139.90.182:/kwan/software/mysqlscp /Users/qinyingjie/Downloads/mysql/mysql-community-libs-compat-8.0.35-1.el7.x86_64.rpm root@43.139.90.182:/kwan/software/mysqlscp /Users/qinyingjie/Downloads/mysql/mysql-community-server-8.0.35-1.el7.x86_64.rpm root@43.139.90.182:/kwan/software/mysql
# 进入mysql的目录cd /kwan/software/mysql
#按如下顺序安装需要的包rpm -ivh mysql-community-common-8.0.35-1.el7.x86_64.rpmrpm -ivh mysql-community-client-plugins-8.0.35-1.el7.x86_64.rpmrpm -ivh mysql-community-libs-8.0.35-1.el7.x86_64.rpmrpm -ivh mysql-community-libs-compat-8.0.35-1.el7.x86_64.rpmrpm -ivh mysql-community-client-8.0.35-1.el7.x86_64.rpmrpm -ivh mysql-community-icu-data-files-8.0.35-1.el7.x86_64.rpmrpm -ivh mysql-community-server-8.0.35-1.el7.x86_64.rpm
[root@localhost mysql_rpm]# rpm -ivh mysql-community-libs-8.0.31-1.el7.x86_64.rpm
警告:mysql-community-libs-8.0.31-1.el7.x86_64.rpm: 头 V4 RSA/SHA256 Signature, 密钥 ID 3a79bd29: NOKEY
错误:依赖检测失败:
mariadb-libs 被 mysql-community-libs-8.0.31-1.el7.x86_64 取代
解决方案
rpm -qa | grep mariadbrpm -e mariadb-libs-5.5.68-1.el7.x86_64rpm -e --nodeps mariadb-libs-5.5.68-1.el7.x86_64
mysqld --initialize --user=mysql
cat /var/log/mysqld.log
[root@localhost ~]# cat /var/log/mysqld.log
2023-02-03T06:55:54.523261Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.31) initializing of server in progress as process 41643
2023-02-03T06:55:54.552161Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-02-03T06:55:55.517362Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2023-02-03T06:55:57.053474Z 6 [Note] [MY-010454] [Server] A temporary passWord is generated for root@localhost: er:ExOzai1b.
er:ExOzaI1b.就是随机生成的密码,先记下来后面会用到。
#启动服务systemctl start mysqld
#状态查看systemctl status mysqld
#停止mysql服务systemctl stop mysqld
#重启mysql服务systemctl restart mysqld
#使用刚记下来的密码mysql -uroot -p
#查看库show databases;#选定库use mysql;
select host, user, plugin, authentication_string, password_expired from user;
#更新root用户的信息update user set host='%' where user='root';
#更新root用户的权限ALTER USER root@'%' IDENTIFIED WITH mysql_native_password BY '156716.';
#刷新权限FLUSH PRIVILEGES;#退出exit
使用 dbeaver 进行连接验证
# 输出8.0.27SELECT VERSION()
Mysql Access denied for user ‘root‘@ ‘…‘ (using password: YES)异常处理
解决办法
#登录mysql -u root -p#查看库show databases;#选定库use mysql;select host, user, plugin, authentication_string, password_expired from user;#更新root用户的信息update user set host='%' where user='root';#更新root用户的权限ALTER USER root@'%' IDENTIFIED WITH mysql_native_password BY '15671628341qyj.';#刷新权限FLUSH PRIVILEGES;#退出客户端exit
觉得有用的话点个赞
👍🏻
呗。
❤️❤️❤️本人水平有限,如有纰漏,欢迎各位大佬评论批评指正!😄😄😄💘💘💘如果觉得这篇文对你有帮助的话,也请给个点赞、收藏下吧,非常感谢!👍 👍 👍
🔥🔥🔥Stay Hungry Stay Foolish 道阻且长,行则将至,让我们一起加油吧!🌙🌙🌙
来源地址:https://blog.csdn.net/qyj19920704/article/details/134935944
--结束END--
本文标题: 【MySQL系列】Centos安装MySQL
本文链接: https://lsjlt.com/news/551646.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-10-23
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0