linux安装mysql(tar.gz)
1. 查看卸载自带的mysql
# rpm -qa|grep MySQL
MySQL-X.X.X
#rpm -e MySQL-X.X.X
# rpm -qa|grep mariadb #有些版本还得查看卸载这个玩意,貌似mysql开源的一个数据库
2. 下载安装包
https://dev.mysql.com/downloads/mysql/5.5.html#downloads(官方下载地址)

位置1:选择对应的版本
位置2:更多版本的链接
备注:下载之后,确定有script目录和bin目录。
3.安装包上传到linux机器上
4. 解压到安装目录
# tar -zxvf mysql-5.5.62-linux-glibc2.12-x86_64.tar.gz -C /opt/module/
# mv mysql-5.5.62-linux-glibc2.12-x86_64 mysql-5.5.62 #重命名一下
5. 修改mysql的配置文件
# vim /etc/my.cnf
[mysql]
# 设置mysql客户端默认字符集
default-character-set=utf8
socket=/var/lib/mysql/mysql.sock
[mysqld]
skip-name-resolve
#设置3306端口
port = 3306
socket=/var/lib/mysql/mysql.sock
# 设置mysql的安装目录,(注意,目录写自己的)
basedir=/opt/module/mysql-5.5.62
# 设置mysql数据库的数据的存放目录, (注意,目录写自己的)
datadir=/opt/module/mysql-5.5.62/data
# 允许最大连接数
max_connections=200
# 服务端使用的字符集默认为8比特编码的latin1字符集
character-set-server=utf8
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB
lower_case_table_name=1
max_allowed_packet=16M
6. 添加mysql用户和用户组
# cd /opt/module/mysql-5.5.62/ #到mysql安装目录
# groupadd mysql
# useradd -g mysql mysql
# chown -R mysql:mysql ./
7. 安装mysql
[root@slave1 mysql-5.5.62]# ./scripts/mysql_install_db --user=mysql --basedir=/opt/module/mysql-5.5.62/ --datadir=/opt/module/mysql-5.5.62/data/
Installing MySQL system tables...
191215 21:20:18 [Warning] Using unique option prefix lower_case_table_name instead of lower_case_table_names is deprecated and will be removed in a future release. Please use the full name instead.
191215 21:20:18 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
191215 21:20:18 [Note] /opt/module/mysql-5.5.62//bin/mysqld (mysqld 5.5.62) starting as process 101287 ...
OK
Filling help tables...
191215 21:20:18 [Warning] Using unique option prefix lower_case_table_name instead of lower_case_table_names is deprecated and will be removed in a future release. Please use the full name instead.
191215 21:20:18 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
191215 21:20:18 [Note] /opt/module/mysql-5.5.62//bin/mysqld (mysqld 5.5.62) starting as process 101294 ...
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:
/opt/module/mysql-5.5.62//bin/mysqladmin -u root password 'new-password'
/opt/module/mysql-5.5.62//bin/mysqladmin -u root -h 192.168.222.101 password 'new-password'
Alternatively you can run:
/opt/module/mysql-5.5.62//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 /opt/module/mysql-5.5.62/ ; /opt/module/mysql-5.5.62//bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /opt/module/mysql-5.5.62//mysql-test ; perl mysql-test-run.pl
Please report any problems at http://bugs.mysql.com/
8. 配置mysql(能通过service start mysql这种命令来启动停止mysql)
# chown -R mysql:mysql data
# chown 777 /etc.my.cnf
# cp ./support-files/mysql.server /etc/rc.d/init.d/mysqld
# chmod +x /etc/rc.d/init.d/mysqld
# chkconfig --add mysqld
# chkconfig --list mysqld
# mkdir /var/lib/mysql
# chmod 777 /var/lib/mysql
9. 配置PATH
# vim /etc/profile
export PATH=$PATH:/opt/module/mysql-5.5.62/bin
# source /etc/profile
10. 启动mysql
[root@slave1 mysql-5.5.62]# service mysqld start
Starting MySQL.Logging to '/opt/module/mysql-5.5.62/data/slave1.err'.
. SUCCESS!
11. 登录mysql
[root@slave1 mysql-5.5.62]# 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.62 MySQL Community Server (GPL)
Copyright (c) 2000, 2018, 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 passport=passport("000000");
ERROR 1193 (HY000): Unknown system variable 'passport'
mysql> set password=password("000000"); #更改一下密码,以后用 000000 登录mysql
Query OK, 0 rows affected (0.02 sec)
mysql> exit
Bye
linux安装mysql(tar.gz)的更多相关文章
- linux 安装jdk-7u45-linux-x64.tar.gz
1.官网下载jdk-7u45-linux-x64.tar.gz 载地址:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-dow ...
- mac 安装 mysql.tar.gz
解压目录到 MySQL 默认安装路径 /usr/local/mysql 下, /usr/local路径不存在时, 先 sudo mkdir /usr/local 创建. # 移动解压后的二进制包到安装 ...
- Centos 安装 mysql tar.gz
http://www.cnblogs.com/coderls/p/6848873.html
- linux安装mysql(shell一键安装)
1. 相关文件(install_mysql.sh.my.cnf.mysqld相关内容在文中最后面) 2. 将上面的文件上传到linux服务器某一目录下 3.给install_mysql.sh赋执行权限 ...
- linux安装mysql服务分两种安装方法:
linux安装mysql服务分两种安装方法: ①源码安装,优点是安装包比较小,只有十多M,缺点是安装依赖的库多,安装编译时间长,安装步骤复杂容易出错: ②使用官方编译好的二进制文件安装,优点是安装速度 ...
- 怎样从Mysql官网下载mysql.tar.gz版本的安装包
今天学习在Linux上部署项目,用到了Mysql,因此想要下载适用于Linux的安装版本,在Mysql官网找了半天,终于找到怎样下载了,这里写出来,以后大家找的时候就好找了. 第一步:在百度输入My ...
- 没有外网情况下linux安装mysql
首先linux要使用局域网 环境要求:局域网, windows系统, linux系统, mysql安装包mysql.tar.gz 注意:32位操作系统用32位安装包,64位系统用64位安装包,不 ...
- linux 安装mysql两种方式
yum -y install gcc gcc-c++ ncurses-devel cmake bison zlib zlib-devel libxml openssl dtrace ...
- linux安装mysql全纪录[包括yum和rpm安装,编码,远程连接以及大小写问题]
linux安装mysql全纪录[包括yum和rpm安装,编码,远程连接以及大小写问题] 一.查看mysql是否已经安装 使用“whereis mysql”命令来查看mysql安装路径: [root@h ...
- kali linux 安装 Mysql Can't read from messagefile 报错解决方案
1.下载安装包 下载地点:https://dev.mysql.com/downloads/mysql/ 或者 wget http://dev.mysql.com/get/Downloads/MySQL ...
随机推荐
- 模拟输入(ADC-A0)
ESP8266具有内置的10位ADC,只有一个ADC通道(A0引脚),即只有一个ADC输入引脚可读取来自外部器件的模拟电压 ESP8266上的ADC通道和芯片供电电压复用,也就是说我们可以将其设置为测 ...
- git clone项目失败,Host key verification failed.
在码云上创建了一个项目,配置好公钥后,克隆到我本地出现以下失败 百度了好久也没有找到解决办法,困扰了好久,后来还是百度到了, 原来是在提示 ey fingerprint is SHA256:FQGC9 ...
- LeetCode--152--乘积最大子序列(python)
给定一个整数数组 nums ,找出一个序列中乘积最大的连续子序列(该序列至少包含一个数). 示例 1: 输入: [2,3,-2,4]输出: 6解释: 子数组 [2,3] 有最大乘积 6.示例 2: 输 ...
- HTML页面滑动到最底部触发事件
其实基本原理做一个判断,如果 页面总高度 = 视口高度 + 浏览器窗口上边界内容高度 ,那么就是把页面滑动到了最低部,然后执行一个事件. //要触发的事件(自己定义事件的内容) functio ...
- IIS部署复盘(杂记)
首先,230是网站服务器,231主要放到是数据库:所以在230(部署的服务器)上部署不需要部署IIS和Oracle数据库, 231呢?231是数据库服务器:百度一下数据库服务器是什么? 文档第五步: ...
- 超大文件上传方案( Java )
1.介绍enctype enctype 属性规定发送到服务器之前应该如何对表单数据进行编码. enctype作用是告知服务器请求正文的MIME类型(请求消息头content-type的作用一样) 1. ...
- 好用的jQuery分页插件
插件源代码: (function ($) { $.fn.extend({ smartpaginator: function (options) { var settings = $.extend({ ...
- adaboost面试题
1.简述权值更新方法 (1)初始化权值分布: (2)找到误差最小的弱分类器: (3)计算弱分类器的权值: (4)更新下一轮样本的权值分布: (5)集合多个弱分类器成一个最终的强分类器. 2.为什么能快 ...
- 一篇面试的考题----jQuery
一.jQuery测试题 下面哪种不是jquery的选择器?(单选)A.基本选择器 B.后代选择器 C.类选择器 D.进一步选择器考点:jquery的选择器 (C) 当DOM加载完成后要执行的函数,下面 ...
- Web引用中文个性字体
最近在前端开发时,因为设计的原因,要引用一些特殊字体(otf格式),但是后来发现这些字体文件非常大,平均每个要8mb左右,严重影响了网页效率.经过一番搜索,发现了前端字体压缩工具(只支持utf-8格式 ...