mysql5.7.17 64位rhel6.5下安装
短信预约 -IT技能 免费直播动态提醒
安装环境:
rhel6.5_64
MySQL Community Server 5.7.17 64位
下载yum安装源文件:
http://dev.mysql.com/get/mysql57-community-release-el6-9.noarch.rpm
安装下载的mysql57-community-release-el6-9.noarch.rpm
[root@rhel-mysql ~]# rpm -Uvh mysql57-community-release-el6-9.noarch.rpm
Preparing... ########################################### [100%]
package mysql57-community-release-el6-9.noarch is already installed
运行yum安装mysql
[root@rhel-mysql ~]# yum install mysql-server
安装完毕后,启动mysql
[root@rhel-mysql ~]# service mysqld start
Initializing MySQL database: [ OK ] --第一次start会出现
Installing validate password plugin: [ OK ] --第一次start会出现
Starting mysqld: [ OK ]
得到初始化root密码
[root@rhel-mysql ~]# grep "password" /var/log/mysqld.log
2016-12-13T15:52:48.468591Z 1 [Note] A temporary password is generated for root@localhost: Tyi>x<a-v3*C
2016-12-13T15:52:53.978420Z 0 [Note] Execution of init_file '/var/lib/mysql/install-validate-password-plugin.8rIs89.sql' started.
2016-12-13T15:52:53.990711Z 0 [Note] Execution of init_file '/var/lib/mysql/install-validate-password-plugin.8rIs89.sql' ended.
2016-12-13T15:52:55.871356Z 0 [Note] Shutting down plugin 'sha256_password'
2016-12-13T15:52:55.871365Z 0 [Note] Shutting down plugin 'mysql_native_password'
2016-12-13T15:52:57.329377Z 3 [Note] Access denied for user 'UNKNOWN_MYSQL_USER'@'localhost' (using password: NO)
在my.cnf中加入validate_password_policy=0
[root@rhel-mysql ~]# vi /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
symbolic-links=0
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
validate_password_policy=0
重启mysql使my.cnf生效
[root@rhel-mysql ~]# service mysqld restart
Stopping mysqld: [ OK ]
Starting mysqld: [ OK ]
运行 mysql_secure_installation,修改root密码,然后全部默认回车
[root@rhel-mysql ~]# mysql_secure_installation
Securing the MySQL server deployment.
Enter password for user root:
The 'validate_password' plugin is installed on the server.
The subsequent steps will run with the existing configuration
of the plugin.
Using existing password for root.
Estimated strength of the password: 50
Change the password for root ? ((Press y|Y for Yes, any other key for No) :
... skipping.
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? (Press y|Y for Yes, any other key for No) :
... skipping.
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? (Press y|Y for Yes, any other key for No) :
Success.
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? (Press y|Y for Yes, any other key for No) :
... skipping.
Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.
Reload privilege tables now? (Press y|Y for Yes, any other key for No) :
Success.
All done!
用新root密码登录数据库
[root@rhel-mysql ~]# mysql -uroot -p11111111
mysql: [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 11
Server version: 5.7.17 MySQL Community Server (GPL)
Copyright (c) 2000, 2016, 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> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.00 sec)
root用户拥有远程登陆的权限
mysql> grant all privileges on *.* to 'root'@'%' identified by '11111111' with grant option;
Query OK, 0 rows affected, 1 warning (0.00 sec)
创建数据库 create datasase zhangsan;
mysql> create database zhangsan;
Query OK, 1 row affected (0.00 sec)
创建用户
mysql> CREATE USER 'hug'@'%' IDENTIFIED BY '12345678';
Query OK, 0 rows affected (0.01 sec)
为新用户是授权
mysql> grant all privileges on zhangsan.* to hug;
Query OK, 0 rows affected (0.00 sec)
至此,mysql 5.7.17 设置完毕
设置mysql自动启动,默认安装完毕后在3、4、5下是默认启动的
[root@rhel-mysql ~]# chkconfig --list mysqld
mysqld 0:off 1:off 2:off 3:on 4:on 5:on 6:off
修改mysqld是否自启动
[root@rhel-mysql ~]# chkconfig --level 345 mysqld off
[root@rhel-mysql ~]# chkconfig --list mysqld
mysqld 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@rhel-mysql ~]# chkconfig --level 345 mysqld on
[root@rhel-mysql ~]# chkconfig --list mysqld
mysqld 0:off 1:off 2:off 3:on 4:on 5:on 6:off
rhel6.5_64
MySQL Community Server 5.7.17 64位
下载yum安装源文件:
http://dev.mysql.com/get/mysql57-community-release-el6-9.noarch.rpm
安装下载的mysql57-community-release-el6-9.noarch.rpm
[root@rhel-mysql ~]# rpm -Uvh mysql57-community-release-el6-9.noarch.rpm
Preparing... ########################################### [100%]
package mysql57-community-release-el6-9.noarch is already installed
运行yum安装mysql
[root@rhel-mysql ~]# yum install mysql-server
安装完毕后,启动mysql
[root@rhel-mysql ~]# service mysqld start
Initializing MySQL database: [ OK ] --第一次start会出现
Installing validate password plugin: [ OK ] --第一次start会出现
Starting mysqld: [ OK ]
得到初始化root密码
[root@rhel-mysql ~]# grep "password" /var/log/mysqld.log
2016-12-13T15:52:48.468591Z 1 [Note] A temporary password is generated for root@localhost: Tyi>x<a-v3*C
2016-12-13T15:52:53.978420Z 0 [Note] Execution of init_file '/var/lib/mysql/install-validate-password-plugin.8rIs89.sql' started.
2016-12-13T15:52:53.990711Z 0 [Note] Execution of init_file '/var/lib/mysql/install-validate-password-plugin.8rIs89.sql' ended.
2016-12-13T15:52:55.871356Z 0 [Note] Shutting down plugin 'sha256_password'
2016-12-13T15:52:55.871365Z 0 [Note] Shutting down plugin 'mysql_native_password'
2016-12-13T15:52:57.329377Z 3 [Note] Access denied for user 'UNKNOWN_MYSQL_USER'@'localhost' (using password: NO)
在my.cnf中加入validate_password_policy=0
[root@rhel-mysql ~]# vi /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
symbolic-links=0
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
validate_password_policy=0
重启mysql使my.cnf生效
[root@rhel-mysql ~]# service mysqld restart
Stopping mysqld: [ OK ]
Starting mysqld: [ OK ]
运行 mysql_secure_installation,修改root密码,然后全部默认回车
[root@rhel-mysql ~]# mysql_secure_installation
Securing the MySQL server deployment.
Enter password for user root:
The 'validate_password' plugin is installed on the server.
The subsequent steps will run with the existing configuration
of the plugin.
Using existing password for root.
Estimated strength of the password: 50
Change the password for root ? ((Press y|Y for Yes, any other key for No) :
... skipping.
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? (Press y|Y for Yes, any other key for No) :
... skipping.
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? (Press y|Y for Yes, any other key for No) :
Success.
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? (Press y|Y for Yes, any other key for No) :
... skipping.
Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.
Reload privilege tables now? (Press y|Y for Yes, any other key for No) :
Success.
All done!
用新root密码登录数据库
[root@rhel-mysql ~]# mysql -uroot -p11111111
mysql: [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 11
Server version: 5.7.17 MySQL Community Server (GPL)
Copyright (c) 2000, 2016, 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> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.00 sec)
root用户拥有远程登陆的权限
mysql> grant all privileges on *.* to 'root'@'%' identified by '11111111' with grant option;
Query OK, 0 rows affected, 1 warning (0.00 sec)
创建数据库 create datasase zhangsan;
mysql> create database zhangsan;
Query OK, 1 row affected (0.00 sec)
创建用户
mysql> CREATE USER 'hug'@'%' IDENTIFIED BY '12345678';
Query OK, 0 rows affected (0.01 sec)
为新用户是授权
mysql> grant all privileges on zhangsan.* to hug;
Query OK, 0 rows affected (0.00 sec)
至此,mysql 5.7.17 设置完毕
设置mysql自动启动,默认安装完毕后在3、4、5下是默认启动的
[root@rhel-mysql ~]# chkconfig --list mysqld
mysqld 0:off 1:off 2:off 3:on 4:on 5:on 6:off
修改mysqld是否自启动
[root@rhel-mysql ~]# chkconfig --level 345 mysqld off
[root@rhel-mysql ~]# chkconfig --list mysqld
mysqld 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@rhel-mysql ~]# chkconfig --level 345 mysqld on
[root@rhel-mysql ~]# chkconfig --list mysqld
mysqld 0:off 1:off 2:off 3:on 4:on 5:on 6:off
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
mysql5.7.17 64位rhel6.5下安装
下载Word文档到电脑,方便收藏和打印~
下载Word文档
猜你喜欢
2024-04-02
2024-04-02
64位下安装python的paramik
首先,不知道是平台原因还是版本原因,在32位linux下安装无任何问题,环境为cent5.5,ptyhon 2.4.3 .到64位下环境为cent6.0,python 2.6.3。 paramiko为linux下连接ssh的python模块
2023-01-31
2024-04-02
2024-04-02
64位Windows下安装Redis教程
Redis对于Linux是官方支持的,安装和使用没有什么好说的,普通使用按照官方指导,5分钟以内就能搞定。详情请参考:http://redis.io/download 但有时候又想在windows下折腾下Redis,可以从redis下载页面
2022-06-04
windows 64位下redis安装教程
一、下载windows版本的Redis
去官网找了很久,发现原来在官网上可以下载的windows版本的,现在官网以及没有下载地址,只能在github上下载,官网只提供linux版本的下载
官网下载地址:http://redis.io/dow
2022-06-04
2024-04-02
win7系统下载64位安装教程
今天主要是和大家分享一个安装win7 64位系统的方法,步骤简单操作易懂,当然如果想要安装其它版本系统也可以用这个方法,选择不同系统几款。1、首先我们需要先百度搜索小白一键重装系统,进入官网下载安装好,然后打开软件选择自己想要的win7 6
2023-07-10
2023-09-01
Redis安装(CentOS 8.5 64位)
Redis的安装,CentOS 8.5 64位 Redis安装1. 准备工作1.1 下载安装包官网下载地址:https://redis.io/1.2 传输文件到服务器使用ssh工具连接到服务器,把下载好的文件上传到服务器,可以直接拖拽到其中一个目录,如
2015-12-29
windows 10 64位安装Pyth
1、下载Python3.6 windows版本的安装包 Python官网地址:https://www.python.org 下载软件包:python-3.6.4.exe 2、安装Python3.6版本,右击软件,以管理员
2023-01-31
2024-04-02
win7 64位安装mysql-pyth
###今天测试个小程序在win7 64位系统下需要安装一下MySQL-python,参考了一下其他博客,发现都不行,最后用以下方法成功了,写一下留作笔记。1、前提是Python2.7和mysql5.7已经都安装成功。2、发现了这个网站:ht
2023-01-31
2024-04-02
win7 64位ghost下载 纯净版安装教程
重装系统对于电脑小白来说也不是一件简单的事,下面跟大家分享一个装机工具,教大家win7纯净版系统安装方法吧。1、在小白一键重装系统官网中下载小白三步装机版软件并打开,软件会自动帮助我们匹配合适的系统,然后点击立即重装。2、接下来软件就会帮助
2023-07-25
Linux(64位)使用安装包安装JDK1.8
要在Linux 64位系统上安装JDK 1.8,您可以按照以下步骤进行操作:1. 首先,在Oracle官网上下载适用于Linux 64位系统的JDK 1.8安装包(tar.gz格式)。2. 打开终端,进入下载目录,并解压下载的压缩包。使用以
2023-09-14
2024-04-02
2024-04-02
64位系统怎么安装32位php
安装32位PHPon64位系统在64位系统上安装32位PHP,需要下载二进制文件并复制到指定目录。设置环境变量“PATH”和“LD_LIBRARY_PATH”以指向PHP二进制文件和库路径。安装必需的库,并创建可选的配置文件。测试安装并验证PHP版本。可通过pecl安装扩展以扩展PHP功能。注意系统架构匹配,扩展兼容性和寻求帮助资源。
2024-04-26