centOS7 安装mysql5.7
mysql5.7相比较mysql5.6而言,有很大进步,特别对于安装来说,要简单得多。现将方法简介而下。
前两步和安装mysql5.6相同。
1、卸载mariadb
rpm -e mariadb-libs-5.5.37-1.el7_0.x86_64
###会提示错误:依赖检测失败
###加上–nodeps参数强制卸载
rpm -e –nodeps mariadb-libs-5.5.37-1.el7_0.x86_64
如果找不到就用yum -y remove mariadb-libs.x86_64
2、下载mysql5.7
进入mysql下载官网,点击左上方的“Community”,选择平台“Red Hat Enterprise Linux”,下载此版本下的mysql-5.7.11-1.el7.x86_64.rpm-bundle.tar(大小为520.7M),如果点击Download会提示你要先登录Oracle帐户,如果没有帐户或者不想登录,可以点击下方的“No thanks,just start my download”,也可一个FTP站点下载,里面包含了几乎所有的mysql版本。
3、安装
解压:tar xvf mysql-5.7.11-1.el7.x86_64.rpm-bundle.tar ,先安装“rpm -ivh mysql-community-common-5.7.11-1.el7.x86_64.rpm”,然后“mysql-community-libs-5.7.11-1.el7.x86_64.rpm”,再“mysql-community-client-5.7.11-1.el7.x86_64.rpm”,“mysql-community-devel-5.7.11-1.el7.x86_64.rpm”,最后“mysql-community-server-5.7.11-1.el7.x86_64.rpm”。
安装后mysql的主要文件如下:
MySQL Installation Layout for Linux RPM Packages from the MySQL Developer Zone
Files or Resources | Location |
Client programs and scripts | /usr/bin |
mysqld server | /usr/sbin |
Configuration file | /etc/my.cnf |
Data directory | /var/lib/mysql |
Error log file | For RHEL, Oracle Linux, CentOS or Fedora platforms: /var/log/mysqld.log
For SLES: /var/log/mysql/mysqld.log |
Value of secure_file_priv | /var/lib/mysql-files |
System V init script | For RHEL, Oracle Linux, CentOS or Fedora platforms: /etc/init.d/mysqld
For SLES: /etc/init.d/mysql |
Systemd service | For RHEL, Oracle Linux, CentOS or Fedora platforms: mysqld
For SLES: mysql |
Pid file | /var/run/mysql/mysqld.pid |
Socket | /var/lib/mysql/mysql.sock |
Keyring directory | /var/lib/mysql-keyring |
Unix manual pages | /usr/share/man |
Include (header) files/usr/include/mysql | |
Libraries | /usr/lib/mysql |
Miscellaneous support files (for example, error messages, and character set files) | /usr/share/mysql |
3、初始化
切换到root用户,启动服务“service mysqld start”,找到root用户的初始密码“grep ‘temporary password’ /var/log/mysqld.log”,用找到的密码登录root用户“mysql -uroot -p ”,改密码“mysql> ALTER USER ‘root’@’localhost’ IDENTIFIED BY ‘yourpasswd’; ”。
相关推荐:
- 吃豆腐新解 441
- 怎样向NCBI提交基因序列 440
- Perl输出函数传递的二维数组 424
- Bioperl的简单快速安装 391
- centOS7 安装mysql5.6 391
最新创建圈子
-
原料药研发及国内外注册申报
2019-01-25 10:41圈主:caolianhui 帖子:33 -
制药工程交流
2019-01-25 10:40圈主:polysciences 帖子:30 -
健康管理
2019-01-25 10:40圈主:neuromics 帖子:20 -
发酵技术
2019-01-25 10:39圈主:fitzgerald 帖子:17 -
医学肿瘤学临床试验
2019-01-25 10:39圈主:bma 帖子:58