centos系统如何rpm安装mysql?
Admin 2023-05-11 群英技术资讯 1095 次浏览
今天就跟大家聊聊有关“centos系统如何rpm安装mysql?”的内容,可能很多人都不太了解,为了让大家认识和更进一步的了解,小编给大家总结了以下内容,希望这篇“centos系统如何rpm安装mysql?”文章能对大家有帮助。 [root@node001 ~]# yum install -y perl
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
base | 3.7 kB 00:00
extras | 3.4 kB 00:00
updates | 3.4 kB 00:00
Setting up Install Process
Package 4:perl-5.10.1-144.el6.x86_64 already installed and latest version
Nothing to do
[root@node001 ~]# rpm -qa | grep mysql
mysql-5.1.73-8.el6_8.x86_64
mysql-libs-5.1.73-8.el6_8.x86_64
mysql-server-5.1.73-8.el6_8.x86_64
[root@node001 ~]# rpm -e mysql-5.1.73-8.el6_8.x86_64 --nodeps
[root@node001 ~]# rpm -e mysql-libs-5.1.73-8.el6_8.x86_64 --nodeps
[root@node001 ~]# rpm -e mysql-server-5.1.73-8.el6_8.x86_64 --nodeps
(--nodeps:忽略其他依赖,直接卸载)
安装包

[root@node001 ~]# tar zxvf mysql.tar.gz
MySQL-client-5.6.28-1.el6.x86_64.rpm
MySQL-devel-5.6.28-1.el6.x86_64.rpm
MySQL-server-5.6.28-1.el6.x86_64.rpm
numactl-2.0.9-2.el6.x86_64.rpm
[root@node001 ~]# rpm -ivh MySQL-client-5.6.28-1.el6.x86_64.rpm
warning: MySQL-client-5.6.28-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ########################################### [100%]
1:MySQL-client ########################################### [100%]
[root@node001 ~]# rpm -ivh MySQL-devel-5.6.28-1.el6.x86_64.rpm
warning: MySQL-devel-5.6.28-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ########################################### [100%]
1:MySQL-devel ########################################### [100%]
[root@node001 ~]# rpm -ivh numactl-2.0.9-2.el6.x86_64.rpm
Preparing... ########################################### [100%]
1:numactl ########################################### [100%]
[root@node001 ~]# rpm -ivh MySQL-server-5.6.28-1.el6.x86_64.rpm
warning: MySQL-server-5.6.28-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ########################################### [100%]
1:MySQL-server ########################################### [100%]
2017-12-24 05:39:08 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestam
p server option (see documentation for more details).2017-12-24 05:39:08 0 [Note] /usr/sbin/mysqld (mysqld 5.6.28) starting as process 1287 ...
2017-12-24 05:39:08 1287 [Note] InnoDB: Using atomics to ref count buffer pool pages
2017-12-24 05:39:08 1287 [Note] InnoDB: The InnoDB memory heap is disabled
2017-12-24 05:39:08 1287 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-12-24 05:39:08 1287 [Note] InnoDB: Memory barrier is not used
2017-12-24 05:39:08 1287 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-12-24 05:39:08 1287 [Note] InnoDB: Using Linux native AIO
2017-12-24 05:39:08 1287 [Note] InnoDB: Using CPU crc32 instructions
2017-12-24 05:39:08 1287 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2017-12-24 05:39:08 1287 [Note] InnoDB: Completed initialization of buffer pool
2017-12-24 05:39:08 1287 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2017-12-24 05:39:08 1287 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2017-12-24 05:39:08 1287 [Note] InnoDB: Database physically writes the file full: wait...
2017-12-24 05:39:09 1287 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2017-12-24 05:39:10 1287 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2017-12-24 05:39:11 1287 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2017-12-24 05:39:11 1287 [Warning] InnoDB: New log files created, LSN=45781
2017-12-24 05:39:11 1287 [Note] InnoDB: Doublewrite buffer not found: creating new
2017-12-24 05:39:11 1287 [Note] InnoDB: Doublewrite buffer created
2017-12-24 05:39:11 1287 [Note] InnoDB: 128 rollback segment(s) are active.
2017-12-24 05:39:11 1287 [Warning] InnoDB: Creating foreign key constraint system tables.
2017-12-24 05:39:11 1287 [Note] InnoDB: Foreign key constraint system tables created
2017-12-24 05:39:11 1287 [Note] InnoDB: Creating tablespace and datafile system tables.
2017-12-24 05:39:11 1287 [Note] InnoDB: Tablespace and datafile system tables created.
2017-12-24 05:39:11 1287 [Note] InnoDB: Waiting for purge to start
2017-12-24 05:39:11 1287 [Note] InnoDB: 5.6.28 started; log sequence number 0
A random root password has been set. You will find it in '/root/.mysql_secret'.
2017-12-24 05:39:11 1287 [Note] Binlog end
2017-12-24 05:39:11 1287 [Note] InnoDB: FTS optimize thread exiting.
2017-12-24 05:39:11 1287 [Note] InnoDB: Starting shutdown...
2017-12-24 05:39:13 1287 [Note] InnoDB: Shutdown completed; log sequence number 1625977
2017-12-24 05:39:13 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestam
p server option (see documentation for more details).2017-12-24 05:39:13 0 [Note] /usr/sbin/mysqld (mysqld 5.6.28) starting as process 1309 ...
2017-12-24 05:39:13 1309 [Note] InnoDB: Using atomics to ref count buffer pool pages
2017-12-24 05:39:13 1309 [Note] InnoDB: The InnoDB memory heap is disabled
2017-12-24 05:39:13 1309 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-12-24 05:39:13 1309 [Note] InnoDB: Memory barrier is not used
2017-12-24 05:39:13 1309 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-12-24 05:39:13 1309 [Note] InnoDB: Using Linux native AIO
2017-12-24 05:39:13 1309 [Note] InnoDB: Using CPU crc32 instructions
2017-12-24 05:39:13 1309 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2017-12-24 05:39:13 1309 [Note] InnoDB: Completed initialization of buffer pool
2017-12-24 05:39:13 1309 [Note] InnoDB: Highest supported file format is Barracuda.
2017-12-24 05:39:13 1309 [Note] InnoDB: 128 rollback segment(s) are active.
2017-12-24 05:39:13 1309 [Note] InnoDB: Waiting for purge to start
2017-12-24 05:39:13 1309 [Note] InnoDB: 5.6.28 started; log sequence number 1625977
2017-12-24 05:39:13 1309 [Note] Binlog end
2017-12-24 05:39:13 1309 [Note] InnoDB: FTS optimize thread exiting.
2017-12-24 05:39:13 1309 [Note] InnoDB: Starting shutdown...
2017-12-24 05:39:15 1309 [Note] InnoDB: Shutdown completed; log sequence number 1625987
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@node001 ~]# cd /etc
上传文件

[root@node001 etc]# ls /etc/my.cnf
/etc/my.cnf
[root@node001 etc]# /usr/bin/mysql_install_db
Installing MySQL system tables...2017-12-24 05:41:57 0 [Note] /usr/sbin/mysqld (mysqld 5.6.28-log) starting as process 1353 ...
2017-12-24 05:41:57 1353 [Note] InnoDB: Using atomics to ref count buffer pool pages
2017-12-24 05:41:57 1353 [Note] InnoDB: The InnoDB memory heap is disabled
2017-12-24 05:41:57 1353 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-12-24 05:41:57 1353 [Note] InnoDB: Memory barrier is not used
2017-12-24 05:41:57 1353 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-12-24 05:41:57 1353 [Note] InnoDB: Using Linux native AIO
2017-12-24 05:41:57 1353 [Note] InnoDB: Using CPU crc32 instructions
2017-12-24 05:41:57 1353 [Note] InnoDB: Initializing buffer pool, size = 64.0M
2017-12-24 05:41:57 1353 [Note] InnoDB: Completed initialization of buffer pool
2017-12-24 05:41:57 1353 [Note] InnoDB: Highest supported file format is Barracuda.
2017-12-24 05:41:57 1353 [Warning] InnoDB: Resizing redo log from 2*3072 to 3*2048 pages, LSN=1625987
2017-12-24 05:41:57 1353 [Warning] InnoDB: Starting to delete and rewrite log files.
2017-12-24 05:41:57 1353 [Note] InnoDB: Setting log file ./ib_logfile101 size to 32 MB
2017-12-24 05:41:58 1353 [Note] InnoDB: Setting log file ./ib_logfile1 size to 32 MB
2017-12-24 05:41:58 1353 [Note] InnoDB: Setting log file ./ib_logfile2 size to 32 MB
2017-12-24 05:41:58 1353 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2017-12-24 05:41:58 1353 [Warning] InnoDB: New log files created, LSN=1625987
2017-12-24 05:41:58 1353 [Note] InnoDB: 128 rollback segment(s) are active.
2017-12-24 05:41:58 1353 [Note] InnoDB: Waiting for purge to start
2017-12-24 05:41:58 1353 [Note] InnoDB: 5.6.28 started; log sequence number 1625987
2017-12-24 05:41:59 1353 [Note] Binlog end
2017-12-24 05:41:59 1353 [Note] InnoDB: FTS optimize thread exiting.
2017-12-24 05:41:59 1353 [Note] InnoDB: Starting shutdown...
2017-12-24 05:42:00 1353 [Note] InnoDB: Shutdown completed; log sequence number 1626134
OK
Filling help tables...2017-12-24 05:42:00 0 [Note] /usr/sbin/mysqld (mysqld 5.6.28-log) starting as process 1376 ...
2017-12-24 05:42:00 1376 [Note] InnoDB: Using atomics to ref count buffer pool pages
2017-12-24 05:42:00 1376 [Note] InnoDB: The InnoDB memory heap is disabled
2017-12-24 05:42:00 1376 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-12-24 05:42:00 1376 [Note] InnoDB: Memory barrier is not used
2017-12-24 05:42:00 1376 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-12-24 05:42:00 1376 [Note] InnoDB: Using Linux native AIO
2017-12-24 05:42:00 1376 [Note] InnoDB: Using CPU crc32 instructions
2017-12-24 05:42:00 1376 [Note] InnoDB: Initializing buffer pool, size = 64.0M
2017-12-24 05:42:00 1376 [Note] InnoDB: Completed initialization of buffer pool
2017-12-24 05:42:00 1376 [Note] InnoDB: Highest supported file format is Barracuda.
2017-12-24 05:42:00 1376 [Note] InnoDB: 128 rollback segment(s) are active.
2017-12-24 05:42:00 1376 [Note] InnoDB: Waiting for purge to start
2017-12-24 05:42:00 1376 [Note] InnoDB: 5.6.28 started; log sequence number 1626134
2017-12-24 05:42:01 1376 [Note] Binlog end
2017-12-24 05:42:01 1376 [Note] InnoDB: FTS optimize thread exiting.
2017-12-24 05:42:01 1376 [Note] InnoDB: Starting shutdown...
2017-12-24 05:42:02 1376 [Note] InnoDB: Shutdown completed; log sequence number 1626144
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
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 192.168.178.161 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.
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl
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
WARNING: Found existing config file /usr/my.cnf on the system.
Because this file might be in use, it was not replaced,
but was used in bootstrap (unless you used --defaults-file)
and when you later start the server.
The new default config file was created as /usr/my-new.cnf,
please compare it with your file and take the changes you need.
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
[root@node001 etc]# service mysql start
Starting MySQL....... SUCCESS!
查看初始化密码
[root@node001 etc]# cat /root/.mysql_secret
# The random password set for the root user at Sun Dec 24 05:39:11 2017 (local time): DMBe85LznCxRo16N

[root@node001 etc]# mysql -u root -pDMBe85LznCxRo16N
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 2
Server version: 5.6.28-log
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> set password=password('mysql');
Query OK, 0 rows affected (0.00 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.00 sec)
原因:默认远程无法连接
授权命令:
mysql> grant all privileges on *.* to 'root'@'%' identified by 'mysql' with grant option;
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
到此,关于“centos系统如何rpm安装mysql?”的学习就结束了,希望能够解决大家的疑惑,另外大家动手实践也很重要,对大家加深理解和学习很有帮助。如果想要学习更多的相关知识,欢迎关注群英网络,小编每天都会给大家分享实用的文章!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:mmqy2019@163.com进行举报,并提供相关证据,查实之后,将立刻删除涉嫌侵权内容。
猜你喜欢
区别:1、less可以按上下方向键来显示上下内容,而more不能通过上下方向键控制显示;2、less不必读整个文件,加载速度比more更快;3、less退出后shell不会留下刚显示的内容,而more退出后会在shell上留下刚显示的内容。
linux下如何查看gcc是否安装?其实查看gcc是否安装的方法很简单,我们执行gcc -v命令就可以知道结果,下面就给大家来简单的介绍一下查看gcc是否安装的方法以及gcc安装要注意的几点,大家可以了解看看。
linux中usleep和sleep的区别:sleep函数用于执行挂起指定的秒数,而usleep功能是执行挂起指定的微秒数。sleep是非系统调用,在库函数中实现,是通过alarm()来设定报警时间的,usleep除了时间单位为微秒以外,在使用上与sleep差不多。
小编来给大家说说关于Linux系统keepalive的使用方法详解的内容,想要了解清楚这方面内容的小伙伴可以跟随小编来一探究竟。希望这篇文章能帮助到大家解决问题。
首先考虑一个问题,计算机网络为什么要采用分层结构,这样做的好处是什么。网络采用分层结构是因为计算机想要相互通信是一件非常麻烦的事情,需要考虑的事情有很多,采用分层结构时为了将一个大的复杂的问题,分割成若干个小的局部问题,然后研究局部问题就比较简单容易些了。
成为群英会员,开启智能安全云计算之旅
立即注册关注或联系群英网络
7x24小时售前:400-678-4567
7x24小时售后:0668-2555666
24小时QQ客服
群英微信公众号
CNNIC域名投诉举报处理平台
服务电话:010-58813000
服务邮箱:service@cnnic.cn
投诉与建议:0668-2555555
Copyright © QY Network Company Ltd. All Rights Reserved. 2003-2020 群英 版权所有
增值电信经营许可证 : B1.B2-20140078 ICP核准(ICP备案)粤ICP备09006778号 域名注册商资质 粤 D3.1-20240008