linux安装mysql-5.6.26

查看工具:winscp

下载地址

http://mirrors.sohu.com/mysql/MySQL-5.6/

文件: mysql-5.6.26-linux-glibc2.5-x86_64.tar.gz

解压

tar -xzf mysql-5.6.26-linux-glibc2.5-x86_64.tar.gz

注:安装目录需要设置到解压目录,否则报以下错误

FATAL ERROR: Could not find ./bin/my_print_defaults

If you compiled from source, you need to run 'make install' to
copy the software into the correct location ready for operation. If you are using a binary release, you must either be at the top
level of the extracted archive, or pass the --basedir option
pointing to that location.

or

FATAL ERROR: Could not find my-default.cnf

If you compiled from source, you need to run 'make install' to
copy the software into the correct location ready for operation. If you are using a binary release, you must either be at the top
level of the extracted archive, or pass the --basedir option
pointing to that location.

将解压的目录放到/usr/local下改为mysql或添加软连接

mv mysql-5.6.26-linux-glibc2.5-x86_64 mysql

or

ln -s  /www/mysql-5.6.26-linux-glibc2.5-x86_64 /usr/local/mysql

增加mysql用户和组

groupadd mysql
useradd -r -g mysql mysql

修改mysql目录及子文件属主和属组

chown -R mysql:mysql mysql

进入mysql目录并安装

cd mysql
scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data

安装过程可能缺少某些文件,一般用 yum install -y xxx 按需安装即可.

实现使用 service mysqll (start|status|stop) 命令操作mysql.

cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql

错误:

[root@localhost mysql]# mysql
-bash: mysql: command not found

解决:配置环境变量,把 export PATH=$PATH:/usr/local/mysql/bin添加到 /etc/profile中, source /etc/profile重新加载环境变量, service mysql start启动mysql服务。

错误:

[root@localhost mysql]# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

解决:

mysql --socket=/var/lib/mysql/mysql.sock
ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock

启动成功

mysql> select version();
+-----------+
| version() |
+-----------+
| 5.6.26 |
+-----------+
1 row in set (0.00 sec)

成功后可能需要往mysql的user表增加新账号

错误:指定了严格模式,为了安全,严格模式禁止通过insert 这种形式直接修改mysql库中的user表进行添加新用户

1364 - Field 'ssl_cipher' doesn't have a default value

解决:

vim /usr/local/mysql/my.cnf
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
改为
sql_mode=NO_ENGINE_SUBSTITUTION 修改密码:
mysql>UPDATE user SET password=PASSWORD('1') where USER='root';
  允许使用用户名root密码1从任何主机连接到mysql服务器
  该创建的root账号只是从外部访问的账号,与内部linux访问该mysql时所用root不同,内部linux访问该mysql的root账号也不是linux的系统root账号
mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '1' WITH GRANT OPTION; 刷新权限
mysql>FLUSH PRIVILEGES; MySql提示:The server quit without updating PID file(…)失败
可能进程里已经存在mysql进程
解决方法:用命令“ps -ef|grep mysqld”查看是否有mysqld进程,如果有使用“kill -9  进程号”杀死,然后重新启动mysqld! 查看CentOS linux版本: cat /etc/issue

root@DB-02 ~]# mysql -u root
-bash: mysql: command not found

原因:这是由于系统默认会查找/usr/bin下的命令,如果这个命令不在这个目录下,当然会找不到命令,我们需要做的就是映射一个链接到/usr/bin目录下,相当于建立一个链接文件。
首先得知道mysql命令或mysqladmin命令的完整路径,比如mysql的路径是:/usr/local/mysql/bin/mysql,我们则可以这样执行命令:

# ln -s /usr/local/mysql/bin/mysql /usr/bin

linux 安装 mysql-5.6.26的更多相关文章

  1. Linux 安装 MySQL 8.0.26 超详细图文步骤

    1.MySQL 8.0.26 下载 官方网站下载 MySQL 8.0.26 安装包,下载地址: https://downloads.mysql.com/archives/community/ 需要注意 ...

  2. linux安装mysql后root无法登录 sql 无法登录

    linux安装mysql后root无法登录 问题:[root@localhost mysql]# mysql -u root -pEnter password: ERROR 1045 (28000): ...

  3. linux安装mysql~~~mysql5.6.12

    Linux安装mysql服务器 准备: MySQL-client-5.6.12-1.rhel5.i386.rpm MySQL-server-5.6.12-1.rhel5.i386.rpm 首先检查环境 ...

  4. linux安装mysql全纪录[包括yum和rpm安装,编码,远程连接以及大小写问题]

    linux安装mysql全纪录[包括yum和rpm安装,编码,远程连接以及大小写问题] 一.查看mysql是否已经安装 使用“whereis mysql”命令来查看mysql安装路径: [root@h ...

  5. linux安装mysql服务分两种安装方法:

    linux安装mysql服务分两种安装方法: ①源码安装,优点是安装包比较小,只有十多M,缺点是安装依赖的库多,安装编译时间长,安装步骤复杂容易出错: ②使用官方编译好的二进制文件安装,优点是安装速度 ...

  6. linux安装MySQL后输入mysql显示 ERROR 2002 (HY000): Can't connect to local MySQL server through socket

    我是小白,大佬勿喷 *** linux安装MySQL后输入mysql显示 ERROR 2002 (HY000): Can't connect to local MySQL server through ...

  7. Linux 安装Mysql(图文教程)

    原文:Linux 安装Mysql(图文教程) 版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明. 本文链接:https://blog.csdn.net ...

  8. Linux 安装 MySQL 8 数据库(图文详细教程)

    本教程手把手教你如何在 Linux 安装 MySQL 数据库,以 CentOS 7为例. 1. 下载并安装 MySQL 官方的 Yum Repository wget -i -c https://re ...

  9. linux 安装mysql数据库——yum安装法

    mysql数据库有多种安装方式,本文只介绍在Linux服务器上最实用.最快捷的mysql server安装方法.一.Linux服务器yum安装(CentOS6.3 64位) 所有在服务器上执行的命令, ...

  10. 虚拟机下linux安装mysql,apache和php

    由于腿伤了,卧床在家折腾下linux,尝试用虚拟机装mysql,apche和php.中间各种波折,装了好几天,觉得有些经验还是要记录下来,让自己别忘了:) 按照下面这篇文章的方法,基本可以顺利安装成功 ...

随机推荐

  1. Facebook开源技术识别网购评论

    1.自然语言处理2.情感分析3.监督学习模型4.词向量 5.fasttext 汉藏语系,是语言系属分类(Language family)的一种,分为汉语族和藏缅语族,是用汉语和藏语的名称概括与其有亲属 ...

  2. 好的 Web 前端年薪会有多少?

    只是一个范围参考,主要是看能力而定. 1. 切图熟练.能写一些JS效果(HTML+CSS+jQuery):5K~10K+2. 具备第一条,并可以熟练用JS开发各种组件:8K-15K+3. 具备第二条, ...

  3. mysql中,now()函数和sysdate()函数有什么区别?

    问题描述: 今天在看mysql的时间函数,now()和sysdate(),记录下两者之间有什么不同. 实验过程: 1.执行以下的两个语句: mysql),now(); +--------------- ...

  4. 2014年王道论坛研究生机试练习赛(二)set 2 货币问题

    题目描述: 已知有面值为1元,2元,5元,10元,20元,50元,100元的货币若干(可认为无穷多),需支付价格为x的物品,并需要恰好支付,即没有找零产生.求,至少需要几张货币才能完成支付.如,若支付 ...

  5. Effective C++ Item 14 Think carefully about copying behavior in resource-managing classe

    In C++, the only code that guaranteed to be executed after an exception is thrown are the destructor ...

  6. swift学习笔记之--类的计算属性

    1,Swift中类可以使用计算属性,即使用get和set来间接获取/改变其他属性的值,代码如下 class Calcuator{ ; ; var sum:Int{ get{ return a + b ...

  7. Android 5.0 API新增和改进

    开始开发 要构建 Android 5.0 版应用,您必须先下载 Android SDK,然后使用 SDK 管理器下载 Android 5.0 SDK 平台和系统映像. 更新您的目标 API 级别 要进 ...

  8. Error setting expression 'XXX' with value 设置表达式“XXX”时出错 解决方法

    1.表达式“xxx”在所调用的action里没有与之对应的对象: 2.action里有该对象作为私有成员变量但是没有get&set方法.

  9. 实现类似printf这样的函数

    来源:http://www.vimer.cn/2009/12/cc%E5%AE%9E%E7%8E%B0%E5%A4%9A%E5%8F%82%E6%95%B0%E5%87%BD%E6%95%B0%E7% ...

  10. poj_1037 动态规划+字典序第k大

    题目大意 给定n个数字,规定一种 cute 排序:序列中的数字大小为严格的波浪形,即 a[0] > a[1] < a[2] > a[3] < .... 或者 a[0] < ...