iis服务器助手广告广告
返回顶部
首页 > 资讯 > 数据库 >Linux如何安装mysql数据库
  • 274
分享到

Linux如何安装mysql数据库

2024-04-02 19:04:59 274人浏览 八月长安
摘要

这篇文章主要为大家展示了“linux如何安装Mysql数据库”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“Linux如何安装mysql数据库”这篇文章吧。

这篇文章主要为大家展示了“linux如何安装Mysql数据库”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“Linux如何安装mysql数据库”这篇文章吧。

[root@szq enterprise]# rpm -ivh Mysql-client-advanced-5.6.24-1.el6.x86_64.rpm
Preparing...                ########################################### [100%]
        package MySQL-client-advanced-5.6.24-1.el6.x86_64 is already installed
[root@szq enterprise]# rpm  -ivh MySQL-shared-advanced-5.6.24-1.el6.x86_64.rpm
Preparing...                ########################################### [100%]
   1:MySQL-shared-advanced  ########################################### [100%]
[root@szq enterprise]# rpm  -ivh MySQL-devel-advanced-5.6.24-1.el6.x86_64.rpm
Preparing...                ########################################### [100%]
   1:MySQL-devel-advanced   ########################################### [100%]
[root@szq enterprise]# rpm -ivh  MySQL-server-advanced-5.6.24-1.el6.x86_64.rpm 
Preparing...                ########################################### [100%]
        file /usr/share/mysql/czech/errmsg.sys from install of MySQL-server-advanced-5.6.24-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.52-1.el6_0.1.x86_64
        file /usr/share/mysql/danish/errmsg.sys from install of MySQL-server-advanced-5.6.24-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.52-1.el6_0.1.x86_64
        file /usr/share/mysql/dutch/errmsg.sys from install of MySQL-server-advanced-5.6.24-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.52-1.el6_0.1.x86_64
        file /usr/share/mysql/english/errmsg.sys from install of MySQL-server-advanced-5.6.24-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.52-1.el6_0.1.x86_64
        file /usr/share/mysql/estonian/errmsg.sys from install of MySQL-server-advanced-5.6.24-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.52-1.el6_0.1.x86_64
        file /usr/share/mysql/french/errmsg.sys from install of MySQL-server-advanced-5.6.24-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.52-1.el6_0.1.x86_64
        file /usr/share/mysql/german/errmsg.sys from install of MySQL-server-advanced-5.6.24-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.52-1.el6_0.1.x86_64

这里报错,一大堆,其实就是因为本系统之前已经有了mysql-libs  这个包,可以查看验证:
[root@szq enterprise]# rpm -qa|grep mysql-libs
mysql-libs-5.1.52-1.el6_0.1.x86_64

先将这个已经存在的安装包卸载,再安装新包:

[root@szq enterprise]# rpm -e mysql-libs-5.1.52-1.el6_0.1.x86_64 
error: Failed dependencies:
        libmysqlclient.so.16()(64bit) is needed by (installed) postfix-2:2.6.6-2.2.el6_1.x86_64
        libmysqlclient.so.16(libmysqlclient_16)(64bit) is needed by (installed) postfix-2:2.6.6-2.2.el6_1.x86_64
        mysql-libs is needed by (installed) postfix-2:2.6.6-2.2.el6_1.x86_64
[root@szq enterprise]#
这里由于依赖关系,报错,我们选择忽略依赖关系的 “--nodeps"选项,就会卸载成功!
[root@szq enterprise]# rpm -e --nodeps mysql-libs-5.1.52-1.el6_0.1.x86_64 
[root@szq enterprise]# 

[root@szq enterprise]# rpm -ivh MySQL-server-advanced-5.6.24-1.el6.x86_64.rpm 
Preparing...                ########################################### [100%]
   1:MySQL-server-advanced  ########################################### [100%]
2016-03-28 14:58:36 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-03-28 14:58:36 0 [Note] /usr/sbin/mysqld (mysqld 5.6.24-enterprise-commercial-advanced) starting as process 27331 ...
2016-03-28 14:58:36 27331 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-03-28 14:58:36 27331 [Note] InnoDB: The InnoDB memory heap is disabled
2016-03-28 14:58:36 27331 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-03-28 14:58:36 27331 [Note] InnoDB: Memory barrier is not used
2016-03-28 14:58:36 27331 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-03-28 14:58:36 27331 [Note] InnoDB: Using Linux native AIO
2016-03-28 14:58:36 27331 [Note] InnoDB: Not using CPU crc32 instructions
2016-03-28 14:58:36 27331 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-03-28 14:58:36 27331 [Note] InnoDB: Completed initialization of buffer pool
2016-03-28 14:58:36 27331 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2016-03-28 14:58:36 27331 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2016-03-28 14:58:36 27331 [Note] InnoDB: Database physically writes the file full: wait...
2016-03-28 14:58:36 27331 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2016-03-28 14:58:41 27331 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2016-03-28 14:58:56 27331 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2016-03-28 14:58:56 27331 [Warning] InnoDB: New log files created, LSN=45781
2016-03-28 14:58:56 27331 [Note] InnoDB: Doublewrite buffer not found: creating new
2016-03-28 14:58:57 27331 [Note] InnoDB: Doublewrite buffer created
2016-03-28 14:58:57 27331 [Note] InnoDB: 128 rollback segment(s) are active.
2016-03-28 14:58:57 27331 [Warning] InnoDB: Creating foreign key constraint system tables.
2016-03-28 14:58:57 27331 [Note] InnoDB: Foreign key constraint system tables created
2016-03-28 14:58:57 27331 [Note] InnoDB: Creating tablespace and datafile system tables.
2016-03-28 14:58:57 27331 [Note] InnoDB: Tablespace and datafile system tables created.
2016-03-28 14:58:57 27331 [Note] InnoDB: Waiting for purge to start
2016-03-28 14:58:57 27331 [Note] InnoDB: 5.6.24 started; log sequence number 0
2016-03-28 14:58:57 27331 [Note] RSA private key file not found: /var/lib/mysql//private_key.pem. Some authentication plugins will not work.
2016-03-28 14:58:57 27331 [Note] RSA public key file not found: /var/lib/mysql//public_key.pem. Some authentication plugins will not work.
A random root passWord has been set. You will find it in '/root/.mysql_secret'.
2016-03-28 14:58:58 27331 [Note] Binlog end
2016-03-28 14:58:58 27331 [Note] InnoDB: FTS optimize thread exiting.
2016-03-28 14:58:58 27331 [Note] InnoDB: Starting shutdown...
2016-03-28 14:59:01 27331 [Note] InnoDB: Shutdown completed; log sequence number 1625977


2016-03-28 14:59:01 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-03-28 14:59:01 0 [Note] /usr/sbin/mysqld (mysqld 5.6.24-enterprise-commercial-advanced) starting as process 27353 ...
2016-03-28 14:59:01 27353 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-03-28 14:59:01 27353 [Note] InnoDB: The InnoDB memory heap is disabled
2016-03-28 14:59:01 27353 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-03-28 14:59:01 27353 [Note] InnoDB: Memory barrier is not used
2016-03-28 14:59:01 27353 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-03-28 14:59:01 27353 [Note] InnoDB: Using Linux native AIO
2016-03-28 14:59:01 27353 [Note] InnoDB: Not using CPU crc32 instructions
2016-03-28 14:59:01 27353 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-03-28 14:59:01 27353 [Note] InnoDB: Completed initialization of buffer pool
2016-03-28 14:59:01 27353 [Note] InnoDB: Highest supported file fORMat is Barracuda.
2016-03-28 14:59:01 27353 [Note] InnoDB: 128 rollback segment(s) are active.
2016-03-28 14:59:01 27353 [Note] InnoDB: Waiting for purge to start
2016-03-28 14:59:01 27353 [Note] InnoDB: 5.6.24 started; log sequence number 1625977
2016-03-28 14:59:01 27353 [Note] RSA private key file not found: /var/lib/mysql//private_key.pem. Some authentication plugins will not work.
2016-03-28 14:59:01 27353 [Note] RSA public key file not found: /var/lib/mysql//public_key.pem. Some authentication plugins will not work.
2016-03-28 14:59:01 27353 [Note] Binlog end
2016-03-28 14:59:01 27353 [Note] InnoDB: FTS optimize thread exiting.
2016-03-28 14:59:01 27353 [Note] InnoDB: Starting shutdown...
2016-03-28 14:59:03 27353 [Note] InnoDB: Shutdown completed; log sequence number 162598

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

[root@szq enterprise]# cat /root/.mysql_secret
# The random password set for the root user at Mon Mar 28 14:58:58 2016 (local time): RK_wpPXYQ7MTjbZy



[root@szq enterprise]# /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, we'll need the current
password for the root user.  If you've just installed MySQL, and
you haven't 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.

You already have a root password set, so you can safely answer 'n'.

Change the 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!

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

Thanks for using MySQL!

Cleaning up...

[root@szq enterprise]# mysql  -pmysql123  (小写的p后面直接跟密码,不能有空格,若有空格,则被认为是db name。其他参数无此要求,可有空格也可无空格。)
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 16
Server version: 5.6.24-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial)


Copyright (c) 2000, 2015, oracle and/or its affiliates. All rights reserved.


Oracle is a reGIStered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.


Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>

以上是“Linux如何安装mysql数据库”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注编程网数据库频道!

您可能感兴趣的文档:

--结束END--

本文标题: Linux如何安装mysql数据库

本文链接: https://www.lsjlt.com/news/62588.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • Linux如何安装mysql数据库
    这篇文章主要为大家展示了“Linux如何安装mysql数据库”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“Linux如何安装mysql数据库”这篇文章吧。 ...
    99+
    2022-10-18
  • Linux——安装mysql数据库
    目录 1、准备阶段 2、具体步骤 2.1、卸载mariadb 2.2、上传mysql并解压 2.3、安装mysql 2.4、查看版本 2.5、启动mysql服务 2.6、登录mysql 2.7、修改密码 2.8、配置mysql远程访问 2....
    99+
    2023-09-06
    linux 运维 服务器
  • linux主机如何安装mysql数据库
    linux主机安装mysql数据库的方法首先,在linux系统命令行中,使用yum命令安装mysql数据库;yum install mysql-community-server等待mysql数据库安装好后,使用以下命令对mysql进行初始化...
    99+
    2022-10-10
  • Linux安装mysql数据库——编译安装
    http://www.cnblogs.com/xiongpq/p/3384681.html 一. mysql5.6版本下载 : http://dev.mysql.com/downloads...
    99+
    2022-10-18
  • linux下安装mysql数据库
    本次安装使用的是虚拟机,系统使用centos6.5 64位版本,mysql使用的是linux通用版本5.7.28 一、下载链接地址https://dev.mysql.com/downloads/mysql/ 选择通用版本下载     二、...
    99+
    2021-08-20
    linux下安装mysql数据库
  • Linux环境下如何安装MySQL数据库
    今天小编给大家分享一下Linux环境下如何安装MySQL数据库的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获,下面我们一起来了解一下吧。1.概述对于my...
    99+
    2023-06-29
  • Linux上如何安装PHP和MySQL数据库
    这篇文章主要讲解了“Linux上如何安装PHP和MySQL数据库”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“Linux上如何安装PHP和MySQL数据库”吧!安装PHP要在Linux上安装...
    99+
    2023-07-05
  • mysql-8.0.32 数据库的安装 (Linux)
    Linux 中 mysql-8.0.32 数据库的安装 缘步骤常见问题解决方案问题一. mysql: error while loading shared libraries: libtinf...
    99+
    2023-09-23
    linux mysql 数据库
  • 如何在Linux系统中安装MySQL数据库
    (一)、准备 1、Linux环境 视频教程:https://www.bilibili.com/video/BV15m4y1d7ZP 2、检查内存 6及以上版本的MySQL要求Linux系统虚拟内存不能...
    99+
    2023-09-26
    mysql 数据库 linux
  • Linux环境下安装MySQL数据库
    目录1.概述2.前期准备2.1下载mysql二进制安装包2.2导入mysql二进制安装包3.mysql部署4.修改mysql密码5.配置mysql阿里云安全组策略1.概述 对于mys...
    99+
    2022-11-13
  • MYSQL数据库安装
    检测是否存在MARIADB 如果系统之前⾃带 Mariadb ,可以先卸载之。 ⾸先查询已安装的 Mariadb 安装包: rpm -qa|grep mariadb 卸载mariadb 删除配置文件,删除数据目录 yum re...
    99+
    2019-03-29
    MYSQL数据库安装
  • 安装Mysql数据库
    1.安装Mysql数据库①下载Mysql数据包wget http://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.35-linux-glibc2.5-x8...
    99+
    2022-10-18
  • 如何安装orchestrator元数据库MySQL
    这篇文章主要为大家展示了“如何安装orchestrator元数据库MySQL”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“如何安装orchestrator元数据...
    99+
    2022-10-18
  • 如何在ubuntu安装mysql数据库
    小编给大家分享一下如何在ubuntu安装mysql数据库,希望大家阅读完这篇文章之后都有所收获,下面让我们一起去探讨吧! 方法:1、打开“Ubuntu Software Cent...
    99+
    2022-10-19
  • Linux下源码安装编译mysql数据库
                MySQL是一种开放源代码的关系型数据库管理系统(RDBMS)...
    99+
    2022-10-18
  • linux服务器怎么安装mysql数据库
    在linux系统中安装mysql数据库的方法首先,在Linux命令行中使用yum命令,安装mysql服务;yum install -y mysql-server mysql mysql-devel等待mysql服务安装好后,重启mysql服...
    99+
    2022-10-24
  • Linux上怎么安装PHP和MySQL数据库
    Linux是一种开放源代码的操作系统,它支持多种编程语言,其中PHP是最流行的一种语言,MySQL是最流行的关系数据库管理系统。在Linux上安装PHP和MySQL是一个非常简单的过程。下面我们将向您介绍如何在Linux上安装PHP和MyS...
    99+
    2023-05-14
    linux php mysql
  • Linux系统安装mysql数据库(超详细)
    目录 1、准备阶段         2、具体步骤 2.1、卸载mariadb 2.2、上传mysql并解压 2.3、安装mysql 2.4、查看版本 2.5、启动mysql服务 2.6、登录mysql 2.7、修改密码 2.8、配置mys...
    99+
    2023-09-05
    mysql 数据库 服务器 linux
  • Linux安装Mysql5.7数据库
    下载地址:https://downloads.mysql.com/archives/community/   1.上传到服务器并解压 tar -xvf mysql-5.7.26-linux-glibc2.12-x86_64.tar...
    99+
    2016-09-11
    Linux安装Mysql5.7数据库
  • windows安装MySQL数据库
    原文:...
    99+
    2021-01-31
    windows安装MySQL数据库 数据库入门 数据库基础教程
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作