CentOS6.5系统,mysql数据库的安装
1.查看数据库中已安装的版本:
[mdata@bogon ~]$ yum list installed|grep mysql
mysql-libs.x86_64 5.1.71-1.el6 @anaconda-CentOS-201311272149.x86_64/6.5
2.移除数据库中已有的版本:
[root@bogon mdata]# yum -y remove mysql-libs.x86_64
...
Complete!
3.下载mysql数据库安装包:
[root@bogon mdata]# wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
--2018-04-12 03:07:43-- http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
Resolving repo.mysql.com... 23.55.208.125
Connecting to repo.mysql.com|23.55.208.125|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5824 (5.7K) [application/x-redhat-package-manager]
Saving to: “mysql-community-release-el6-5.noarch.rpm”
100%[======================================>] 5,824 11.7K/s in 0.5s
2018-04-12 03:07:43 (11.7 KB/s) - “mysql-community-release-el6-5.noarch.rpm” saved [5824/5824]
4.解压压缩包:
[root@bogon mdata]# rpm -ivh mysql-community-release-el6-5.noarch.rpm
Preparing... ########################################### [100%]
1:mysql-community-release########################################### [100%]
5.查看解压结果:
[root@bogon mdata]# yum repolist all|grep mysql
mysql-connectors-community MySQL Connectors Community enabled: 45
mysql-connectors-community-source MySQL Connectors Community - So disabled
mysql-tools-community MySQL Tools Community enabled: 57
mysql-tools-community-source MySQL Tools Community - Source disabled
mysql55-community MySQL 5.5 Community Server disabled
mysql55-community-source MySQL 5.5 Community Server - So disabled
mysql56-community MySQL 5.6 Community Server enabled: 415
mysql56-community-source MySQL 5.6 Community Server - So disabled
mysql57-community-dmr MySQL 5.7 Community Server Deve disabled
mysql57-community-dmr-source MySQL 5.7 Community Server Deve disabled
6.安装mysql数据库:
[root@bogon mdata]# yum install mysql-community-server -y
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirror.bit.edu.cn
* updates: mirror.bit.edu.cn
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-server.x86_64 0:5.6.39-2.el6 will be installed
--> Processing Dependency: mysql-community-common(x86-64) = 5.6.39-2.el6 for package: mysql-community-server-5.6.39-2.el6.x86_64
--> Processing Dependency: mysql-community-client(x86-64) >= 5.6.10 for package: mysql-community-server-5.6.39-2.el6.x86_64
--> Processing Dependency: perl(DBI) for package: mysql-community-server-5.6.39-2.el6.x86_64
--> Running transaction check
---> Package mysql-community-client.x86_64 0:5.6.39-2.el6 will be installed
--> Processing Dependency: mysql-community-libs(x86-64) >= 5.6.10 for package: mysql-community-client-5.6.39-2.el6.x86_64
---> Package mysql-community-common.x86_64 0:5.6.39-2.el6 will be installed
---> Package perl-DBI.x86_64 0:1.609-4.el6 will be installed
--> Running transaction check
---> Package mysql-community-libs.x86_64 0:5.6.39-2.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
mysql-community-server x86_64 5.6.39-2.el6 mysql56-community 55 M
Installing for dependencies:
mysql-community-client x86_64 5.6.39-2.el6 mysql56-community 18 M
mysql-community-common x86_64 5.6.39-2.el6 mysql56-community 308 k
mysql-community-libs x86_64 5.6.39-2.el6 mysql56-community 1.9 M
perl-DBI x86_64 1.609-4.el6 base 705 k
Transaction Summary
================================================================================
Install 5 Package(s)
Total download size: 75 M
Installed size: 337 M
Downloading Packages:
(1/5): mysql-community-client-5.6.39-2.el6.x86_64.rpm | 18 MB 13:18
(2/5): mysql-community-common-5.6.39-2.el6.x86_64.rpm | 308 kB 00:15
(3/5): mysql-community-libs-5.6.39-2.el6.x86_64.rpm | 1.9 MB 01:19
(4/5): mysql-community-server-5.6.39-2.el6.x86_64.rpm | 55 MB 42:12
(5/5): perl-DBI-1.609-4.el6.x86_64.rpm | 705 kB 00:01
--------------------------------------------------------------------------------
Total 22 kB/s | 75 MB 57:08
warning: rpmts_HdrFromFdno: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Retrieving key from file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Importing GPG key 0x5072E1F5:
Userid : MySQL Release Engineering <mysql-build@oss.oracle.com>
Package: mysql-community-release-el6-5.noarch (installed)
From : file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Importing GPG key 0xC105B9DE:
Userid : CentOS-6 Key (CentOS 6 Official Signing Key) <centos-6-key@centos.org>
Package: centos-release-6-5.el6.centos.11.1.x86_64 (@anaconda-CentOS-201311272149.x86_64/6.5)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Installing : mysql-community-common-5.6.39-2.el6.x86_64 1/5
Installing : mysql-community-libs-5.6.39-2.el6.x86_64 2/5
Installing : mysql-community-client-5.6.39-2.el6.x86_64 3/5
Installing : perl-DBI-1.609-4.el6.x86_64 4/5
Installing : mysql-community-server-5.6.39-2.el6.x86_64 5/5
Verifying : mysql-community-server-5.6.39-2.el6.x86_64 1/5
Verifying : mysql-community-libs-5.6.39-2.el6.x86_64 2/5
Verifying : mysql-community-client-5.6.39-2.el6.x86_64 3/5
Verifying : mysql-community-common-5.6.39-2.el6.x86_64 4/5
Verifying : perl-DBI-1.609-4.el6.x86_64 5/5
Installed:
mysql-community-server.x86_64 0:5.6.39-2.el6
Dependency Installed:
mysql-community-client.x86_64 0:5.6.39-2.el6
mysql-community-common.x86_64 0:5.6.39-2.el6
mysql-community-libs.x86_64 0:5.6.39-2.el6
perl-DBI.x86_64 0:1.609-4.el6
Complete!
7.查看已安装的数据库版本:
[root@bogon mdata]# yum list installed|grep mysql
mysql-community-client.x86_64
5.6.39-2.el6 @mysql56-community
mysql-community-common.x86_64
5.6.39-2.el6 @mysql56-community
mysql-community-libs.x86_64
5.6.39-2.el6 @mysql56-community
mysql-community-release.noarch
mysql-community-server.x86_64
5.6.39-2.el6 @mysql56-community
8.添加开机启动项:
[root@bogon mdata]# chkconfig --list|grep mysqld
mysqld 0:off 1:off 2:off 3:on 4:on 5:on 6:off
[root@bogon mdata]# chkconfig mysql on
error reading information on service mysql: No such file or directory
[root@bogon mdata]# chkconfig mysqld on
9.启动mysql服务器:
[root@bogon mdata]# service mysqld start
Initializing MySQL database: 2018-04-12 05:38:48 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-04-12 05:38:48 0 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
2018-04-12 05:38:48 0 [Note] /usr/sbin/mysqld (mysqld 5.6.39) starting as process 18488 ...
2018-04-12 05:38:48 18488 [Note] InnoDB: Using atomics to ref count buffer pool pages
2018-04-12 05:38:48 18488 [Note] InnoDB: The InnoDB memory heap is disabled
2018-04-12 05:38:48 18488 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-04-12 05:38:48 18488 [Note] InnoDB: Memory barrier is not used
2018-04-12 05:38:48 18488 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-04-12 05:38:48 18488 [Note] InnoDB: Using Linux native AIO
2018-04-12 05:38:48 18488 [Note] InnoDB: Using CPU crc32 instructions
2018-04-12 05:38:48 18488 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2018-04-12 05:38:48 18488 [Note] InnoDB: Completed initialization of buffer pool
2018-04-12 05:38:48 18488 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2018-04-12 05:38:48 18488 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2018-04-12 05:38:48 18488 [Note] InnoDB: Database physically writes the file full: wait...
2018-04-12 05:38:48 18488 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2018-04-12 05:38:48 18488 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2018-04-12 05:38:49 18488 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2018-04-12 05:38:49 18488 [Warning] InnoDB: New log files created, LSN=45781
2018-04-12 05:38:49 18488 [Note] InnoDB: Doublewrite buffer not found: creating new
2018-04-12 05:38:49 18488 [Note] InnoDB: Doublewrite buffer created
2018-04-12 05:38:49 18488 [Note] InnoDB: 128 rollback segment(s) are active.
2018-04-12 05:38:49 18488 [Warning] InnoDB: Creating foreign key constraint system tables.
2018-04-12 05:38:49 18488 [Note] InnoDB: Foreign key constraint system tables created
2018-04-12 05:38:49 18488 [Note] InnoDB: Creating tablespace and datafile system tables.
2018-04-12 05:38:49 18488 [Note] InnoDB: Tablespace and datafile system tables created.
2018-04-12 05:38:49 18488 [Note] InnoDB: Waiting for purge to start
2018-04-12 05:38:49 18488 [Note] InnoDB: 5.6.39 started; log sequence number 0
2018-04-12 05:38:49 18488 [Note] Binlog end
2018-04-12 05:38:49 18488 [Note] InnoDB: FTS optimize thread exiting.
2018-04-12 05:38:49 18488 [Note] InnoDB: Starting shutdown...
2018-04-12 05:38:51 18488 [Note] InnoDB: Shutdown completed; log sequence number 1625977
2018-04-12 05:38:51 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-04-12 05:38:51 0 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
2018-04-12 05:38:51 0 [Note] /usr/sbin/mysqld (mysqld 5.6.39) starting as process 18510 ...
2018-04-12 05:38:51 18510 [Note] InnoDB: Using atomics to ref count buffer pool pages
2018-04-12 05:38:51 18510 [Note] InnoDB: The InnoDB memory heap is disabled
2018-04-12 05:38:51 18510 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-04-12 05:38:51 18510 [Note] InnoDB: Memory barrier is not used
2018-04-12 05:38:51 18510 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-04-12 05:38:51 18510 [Note] InnoDB: Using Linux native AIO
2018-04-12 05:38:51 18510 [Note] InnoDB: Using CPU crc32 instructions
2018-04-12 05:38:51 18510 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2018-04-12 05:38:51 18510 [Note] InnoDB: Completed initialization of buffer pool
2018-04-12 05:38:51 18510 [Note] InnoDB: Highest supported file format is Barracuda.
2018-04-12 05:38:51 18510 [Note] InnoDB: 128 rollback segment(s) are active.
2018-04-12 05:38:51 18510 [Note] InnoDB: Waiting for purge to start
2018-04-12 05:38:51 18510 [Note] InnoDB: 5.6.39 started; log sequence number 1625977
2018-04-12 05:38:51 18510 [Note] Binlog end
2018-04-12 05:38:51 18510 [Note] InnoDB: FTS optimize thread exiting.
2018-04-12 05:38:51 18510 [Note] InnoDB: Starting shutdown...
2018-04-12 05:38:53 18510 [Note] InnoDB: Shutdown completed; log sequence number 1625987
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h bogon password 'new-password'
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. 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
Note: new default config file not created.
Please make sure your config file is current
WARNING: Default config file /etc/my.cnf exists on the system
This file will be read by default by the MySQL server
If you do not want to use this, either remove it, or use the
--defaults-file argument to mysqld_safe when starting the server
[ OK ]
Starting mysqld: [ OK ]
10.mysql数据库安全设置(密码设置):
[root@bogon mdata]# 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.
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...
ERROR 1008 (HY000) at line 1: Can't drop database 'test'; database doesn't exist
... Failed! Not critical, keep moving...
- 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...
11.授权远程登录:
[root@bogon mdata]# mysql -uroot -p密码
mysql> grant all privileges on *.* to 'root'@'%' identified by 'mdata2018' with grant option;
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
12.关闭防火墙:
service iptables stop
CentOS6.5系统,mysql数据库的安装的更多相关文章
- [转] Linux学习之CentOS(十三)--CentOS6.4下Mysql数据库的安装与配置
from: http://www.cnblogs.com/xiaoluo501395377/archive/2013/04/07/3003278.html 如果要在Linux上做j2ee开发,首先得 ...
- Linux学习之CentOS(十三)--CentOS6.4下Mysql数据库的安装与配置
原文:http://www.cnblogs.com/xiaoluo501395377/archive/2013/04/07/3003278.html 如果要在Linux上做j2ee开发,首先得搭建好j ...
- CentOS6.4下Mysql数据库的安装与配置
原文连接:http://www.cnblogs.com/xiaoluo501395377/archive/2013/04/07/3003278.html 说到数据库,我们大多想到的是关系型数据库,比如 ...
- Linux学习之CentOS(十三)--CentOS6.4下Mysql数据库的安装与配置(转)
原文地址:http://www.cnblogs.com/xiaoluo501395377/archive/2013/04/07/3003278.html 如果要在Linux上做j2ee开发,首先得搭建 ...
- Linux学习之CentOS(一)--CentOS6.6下Mysql数据库的安装与配置
在这里我是通过yum来进行mysql数据库的安装的,通过这种方式进行安装,可以将跟mysql相关的一些服务.jar包都给我们安装好,所以省去了很多不必要的麻烦!!! [root@larry ~]# c ...
- Linux CentOS6.4下Mysql数据库的安装与配置
一.mysql简介 说到数据库,我们大多想到的是关系型数据库,比如mysql.oracle.sqlserver等等,这些数据库软件在windows上安装都非常的方便,在Linux上如果要安装数据库,咱 ...
- CentOS6.5下Mysql数据库的安装与配置
一.mysql简介 说到数据库,我们大多想到的是关系型数据库,比如mysql.oracle.sqlserver等等,这些数据库软件在windows上安装都非常的方便,在Linux上如果要安装数据库,咱 ...
- CentOS6.4下Mysql数据库的安装与配置,导入数据库,授权远程ip
卸载掉原有mysql 由于mysql数据库在Linux上实在是太流行了,所以眼下下载的主流Linux系统版本号基本上都集成了mysql数据库在里面,我们能够通过例如以下命令来查看我们的操作系统上是否已 ...
- 00-Windows系统MySQL数据库的安装
1.数据库安装 官网下载MySQL数据库. 下载安装包后解压缩到相关目录,我解压缩到:D:\360极速浏览器下载\mysql-8.0.19-winx64. 打开刚刚解压的文件夹 D:\360极速浏览器 ...
- linux学习之centos(三):mysql数据库的安装和配置
前言:mysql简介 说到数据库,我们大多想到的是关系型数据库,比如mysql.oracle.sqlserver等等,这些数据库软件在windows上安装都非常的方便,在Linux上如果要安装数据库, ...
随机推荐
- IE7下onclick事件失效的问题
http://blog.csdn.net/spy19881201/article/details/11066975?locationNum=15 $('#abc').unbind('click').c ...
- classmethod作用
>>> class A(object): bar = 1 def func1(self): print 'foo' >>> class A(object): bar ...
- Git忽略已经被版本控制的文件(添加.gitignore不会起作用)
说明:已经被维护起来的文件(需要被远程仓库控制),即使加入.gitignore也会无济于事. .gitignore只对那些只存在在本地,而不在远程仓库的文件起作用.(untraked file). 操 ...
- mysql中的多表查询
基本模式:t1 CROSS JOIN t2, t1 INNER JOIN T2 ON ,以及LEFTJOIN 和RIGHT JOIN. 这些都需要在实践中使用,多练习才行. 写一句sql语句:SELE ...
- Spring-Boot 访问Controller时报错可能会是这个坑
报错信息: 代码: @Controller("/index") public class IndexController extends BaseController{ @GetM ...
- stm32f769ni-discovery编译例程需要修改
找不到cmsis_os.h: 方法:在pack文件夹下找cmsis_os.h文件,有四个,选RTOS2文件夹下的. 原因:cmsis_os2.h是新版本,cmsis_os.h封装了cmsis_os2. ...
- Linux:使用rpcgen实现64位程序调用32位库函数
摘要:本文介绍使用rpcgent实现64位程序调用32位库函数的方法,并给出样例代码. 我的问题 我的程序运行在64位Linux系统上,需要使用一个从外部获得的共享库中的函数,这个共享库是32位的,无 ...
- Java 8 Stream API说明
Java 8增加了很多强大的功能,流(stream)就是其中之一.现在对api的使用做个说明: map 对流中的元素做转换,目前jdk提供了mapToInt,mapToLong,mapToDouble ...
- 《Maven实战》文字版[PDF]
从亚马逊买的电子书,导出来的,需要的下吧. 下面是截图: 除了代码部分有一点点不清楚之外,其他还是蛮清楚的. 下载地址: http://download.csdn.net/download/apple ...
- python ssh之paramiko模块使用
1.安装: sudo pip install paramiko 2.连接到linux服务器 方法一: #paramiko.util.log_to_file('ssh.log') #写日志文件 clie ...