centos7下安装mysql5.5.48

首先说明一下:原本我是跟着尚硅谷的周阳老师的视频去安装mysql的,但是槽点来啦!!!!

老是报这个错误

libgcc_s.so.1 must be installed for pthread_cancel to work

百度一下(面向百度编程),结果搞了好久,不行,我真的是佛了,算了,还是自己百度安装吧!

说到这里,我不知道是不是 centos版本的问题,因为老师的是centos6,而7 自带了mariadb,直接

安装会不会用冲突!!

 

版本:centos7

mysql: 5.5.48

这里说一下去官网下靠谱点

 

 

找到一篇靠谱的博客 ,参照这个来搞  :https://blog.csdn.net/qq_34983808/article/details/78757669

1、上传下载到的MySQL rpm  包到虚拟机centos上并解压到指定的目录下

资源(拿走不谢) https://pan.baidu.com/s/1CpmcJ077SyFCyIG_bdWBUQ   提取码 x9lw

 

2、卸载centos7自带的mariadb,不然安装MySQL的时候会和mariadb文件相冲突导致安装不成功

     1) 查看有没有rpm安装过mariadb :  rpm -qa | grep mariadb

   2)   移除mariadb  :  rpm -e --nodeps mariadb-libs-5.5.64-1.el7.x86_64

      按照上述博客来搞有报错,没错的自动忽略,解决错误:https://blog.csdn.net/Hiqingtian/article/details/79022586 

 

3、安装MySQL服务端和客户端

rpm -ivh MySQL-server-5.5.48-1.linux2.6.x86_64.rpm

rpm -ivh MySQL-client-5.5.48-1.linux2.6.x86_64.rpm

centos7下安装mysql5.5.48

 

 

4、查看MySQL启动状态 :service mysql status

  开启MySQL服务:service mysql start

centos7下安装mysql5.5.48

 

 

5、修改密码

[root@localhost ~]# /usr/bin/mysql_secure_installation




NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!


In order to log into MySQL to secure it, well need the current
password for the root user.  If youve just installed MySQL, and
you havent set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): 
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

Set root password? [Y/n] Y
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
 ... Success!

Normally, root should only be allowed to connect from ‘localhost‘.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] n
 ... skipping.

By default, MySQL comes with a database named ‘test‘ that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...



All done!  If youve completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!

 

6、登录测试

mysql -uroot -phouchen

centos7下安装mysql5.5.48

 

centos7下安装mysql5.5.48

上一篇:Jmeter连接postgresql数据库进行压测


下一篇:asp.net core 3.1部署到centos7.3服务器