fedora25 采用二进制包安装mysql5.5.49
#添加用户和组
groupadd mysql
useradd -s /sbin/nologin -g mysql -M mysql
tail - /etc/passwd
id mysql
#安装依赖包
[root@zabbix-server mysql]# dnf install libncurses.so. -y
#开始安装MySQL
[root@zabbix-server tools]# http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.49-linux2.6-x86_64.tar.gz
[root@zabbix-server tools]# cd /home/nulige/tools
[root@zabbix-server tools]# ll
total 181516
-rw-r--r--. 1 root root 185870973 Jun 22 02:40 mysql-5.5.49-linux2.6-x86_64.tar.gz
[root@zabbix-server tools]# tar xf mysql-5.5.49-linux2.6-x86_64.tar.gz
[root@zabbix-server tools]# mkdir -p /application/
[root@zabbix-server tools]# mv mysql-5.5.49-linux2.6-x86_64 /application/mysql-5.5.49
[root@zabbix-server tools]# ln -s /application/mysql-5.5.49/ /application/mysql
[root@zabbix-server tools]# ls -l /application/mysql
lrwxrwxrwx. 1 root root 26 Jun 22 02:41 /application/mysql -> /application/mysql-5.5.49/
[root@zabbix-server tools]# cd /application/mysql/
[root@zabbix-server mysql]# ls -l support-files/*.cnf
-rw-r--r--. 1 7161 wheel 4691 Mar 1 2016 support-files/my-huge.cnf
-rw-r--r--. 1 7161 wheel 19759 Mar 1 2016 support-files/my-innodb-heavy-4G.cnf
-rw-r--r--. 1 7161 wheel 4665 Mar 1 2016 support-files/my-large.cnf
-rw-r--r--. 1 7161 wheel 4676 Mar 1 2016 support-files/my-medium.cnf
-rw-r--r--. 1 7161 wheel 2840 Mar 1 2016 support-files/my-small.cnf
[root@zabbix-server mysql]# /bin/cp support-files/my-small.cnf /etc/my.cnf
[root@zabbix-server mysql]# mkdir -p /application/mysql/data
[root@zabbix-server mysql]# chown -R mysql.mysql /application/mysql/
[root@zabbix-server mysql]# /application/mysql/scripts/mysql_install_db --basedir=/application/mysql --datadir=/application/mysql/data --user=mysql
Installing MySQL system tables...
170622 2:42:34 [Note] /application/mysql/bin/mysqld (mysqld 5.5.49) starting as process 7032 ...
OK
Filling help tables...
170622 2:42:35 [Note] /application/mysql/bin/mysqld (mysqld 5.5.49) starting as process 7039 ...
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:
/application/mysql/bin/mysqladmin -u root password 'new-password'
/application/mysql/bin/mysqladmin -u root -h zabbix-server password 'new-password'
Alternatively you can run:
/application/mysql/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 /application/mysql ; /application/mysql/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /application/mysql/mysql-test ; perl mysql-test-run.pl
Please report any problems at http://bugs.mysql.com/
[root@zabbix-server mysql]# cp support-files/mysql.server /etc/init.d/mysqld
[root@zabbix-server mysql]# chmod +x /etc/init.d/mysqld
[root@zabbix-server mysql]# ll /etc/init.d/mysqld
-rwxr-xr-x. 1 root root 10880 Jun 22 02:42 /etc/init.d/mysqld
[root@zabbix-server mysql]# sed -i 's#/usr/local/mysql#/application/mysql#g' /application/mysql/bin/mysqld_safe /etc/init.d/mysqld
[root@zabbix-server mysql]# service mysqld start
Unit mysqld.service could not be found.
Starting MySQL... SUCCESS!
[root@zabbix-server mysql]# netstat -lntup|grep mysql
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 7314/mysqld
[root@zabbix-server mysql]# chkconfig --add mysqld
[root@zabbix-server mysql]# chkconfig mysqld on
[root@zabbix-server mysql]# chkconfig --list mysqld
Note: This output shows SysV services only and does not include native
systemd services. SysV configuration data might be overridden by native
systemd configuration.
If you want to list systemd services use 'systemctl list-unit-files'.
To see services enabled on particular target use
'systemctl list-dependencies [target]'.
mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@zabbix-server mysql]# echo 'export PATH=/application/mysql/bin:$PATH' >>/etc/profile
[root@zabbix-server mysql]# tail -1 /etc/profile
export PATH=/application/mysql/bin:$PATH
[root@zabbix-server mysql]# source /etc/profile
[root@zabbix-server mysql]# echo $PATH
/application/mysql/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
[root@zabbix-server mysql]# mysql -uroot -p
Enter password: 不知道密码。
#准备修改原始密码
[root@zabbix-server mysql]# service mysqld stop
Shutting down MySQL. SUCCESS!
[root@zabbix-server mysql]# mysqld_safe --skip-grant-tables&
[1] 7584
[root@zabbix-server mysql]# 170622 03:06:08 mysqld_safe Logging to '/application/mysql/data/zabbix-server.err'.
170622 03:06:08 mysqld_safe Starting mysqld daemon with databases from /application/mysql/data
#登录mysql
[root@zabbix-server mysql]# mysql -uroot -p
Enter password: #直接回车,不需要密码
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.49 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> UPDATE mysql.user SET password=PASSWORD("********") WHERE user='root';
Query OK, 3 rows affected (0.00 sec)
Rows matched: 4 Changed: 3 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
#登录数据库
[root@zabbix-server mysql]# mysql -uroot -p
Enter password: 输入新密码
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.49 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 |
| test |
+--------------------+
4 rows in set (0.00 sec)
mysql> exit
Bye
fedora25 采用二进制包安装mysql5.5.49的更多相关文章
- MySQL5.7单实例二进制包安装方法
MySQL5.7单实例二进制包安装方法 一.环境 OS: CentOS release 6.9 (Final)MySQL: mysql-5.7.20-linux-glibc2.12-x86_64.ta ...
- mysql二进制包安装与配置实战记录
导读 一般中小型网站的开发都选择 MySQL 作为网站数据库,由于其社区版的性能卓越,搭配 PHP .Linux和 Apache 可组成良好的开发环境,经过多年的web技术发展,在业内被广泛使用的一种 ...
- 二进制包安装MySQL数据库
1.1二进制包安装MySQL数据库 1.1.1 安装前准备(规范) [root@Mysql_server ~]# mkdir -p /home/zhurui/tools ##创建指定工具包存放路径 [ ...
- MySQL二进制包安装
mysql的安装有多种方法,这里就介绍一下二进制包安装. [root@node1 ~]# tar xvf mysql-5.7.27-linux-glibc2.12-x86_64.tar [root@n ...
- MySQL二进制包安装及启动问题排查
环境部署:VMware10.0+CentOS6.9(64位)+MySQL5.7.19(64位)一.操作系统调整 # 更改时区 .先查看时区 [root@localhost ~]# date -R Tu ...
- liunx系统二进制包安装编译mysql数据库
liunx系统二进制包安装编译mysql数据库 # 解压二进制压缩包 [root@localhost ~]# tar xf mysql-5.5.32-linux2.6-x86_64.tar.gz -C ...
- kubernetes实践之一:kubernetes二进制包安装
kubernetes二进制部署 1.环境规划 软件 版本 Linux操作系统 CentOS Linux release 7.6.1810 (Core) Kubernetes 1.9 Docker 18 ...
- centos6.5环境通过rpm包安装mysql5.5.51数据库
centos6.5环境通过rpm包安装mysql5.5.51数据库 注意:此方法适用于单独安装数据库的需求,如果在该机器上还需要安装php环境,建议mysql通过编译或yum方式安装 1.查找已经安装 ...
- Mysql 通用二进制包安装
通用二进制包安装 注意:这里有严格的平台问题: 使用时:centos5.5版本 (类似Windows下的绿色包) 下载(mirrors.sohu.com/mysql) 直接使用tar 解压到指 ...
随机推荐
- HDU1018 (斯特林公式)
Big Number Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total ...
- ios的概述和了解的个人总结
ios的概述: ios 为apple手持设备系统: OS X 为apple的macbook.imac.mac min等的操作系统: 应用程序的格式:dmg pkg app iphone 第 ...
- Selenium2+python自动化55-unittest之装饰器(@classmethod)【转载】
前言 前面讲到unittest里面setUp可以在每次执行用例前执行,这样有效的减少了代码量,但是有个弊端,比如打开浏览器操作,每次执行用例时候都会重新打开,这样就会浪费很多时间. 于是就想是不是可以 ...
- Selenium2+python自动化47-判断弹出框存在(alert_is_present)【转载】
前言 系统弹窗这个是很常见的场景,有时候它不弹出来去操作的话,会抛异常.那么又不知道它啥时候会出来,那么久需要去判断弹窗是否弹出了. 本篇接着Selenium2+python自动化42-判断元素(ex ...
- Java语言中的协变和逆变(zz)
转载声明: 本文转载至:http://swiftlet.net/archives/1950 协变和逆变指的是宽类型和窄类型在某种情况下的替换或交换的特性.简单的说,协变就是用一个窄类型替代宽类型,而逆 ...
- 使用bottle进行web开发(4):HTTPError
from bottle import error @error(404) def error404(error): return 'Nothing here, sorry' 上述代码,是对404的定义 ...
- 对json同属性字段压缩
function jsonPack(obj,ifOrder) { var result = [] // var nameArr = Object.keys(obj[0]); 非有序遍历 var nam ...
- Sublime text3 插件ColorPicker(调色板)不能使用快捷键的解决方法
我的原因是:convertToUTF8和ColorPicker快捷键冲突,convertoUTF8的默认转换GBK的快捷键 和 ColorPicker打开调色板的快捷键都是ctrl+shift+c . ...
- asp.net中利用JSON进行增删改查中运用到的方法
//asp.net中 利用JSON进行操作, //增加: //当点击“增加链接的时候”,弹出增加信息窗口,然后,在窗体中输入完整信息,点击提交按钮. //这里我们需要考虑这些:我会进行异步提交,使用j ...
- 2017中国大学生程序设计竞赛 - 女生专场B【DP】
B HDU - 6024 [题意]:n个教室,选一些教室建造糖果商店. 每个教室,有一个坐标xi和在这个教室建造糖果商店的花费ci. 对于每一个教室,如果这个教室建造糖果商店,花费就是ci,否则就是与 ...