Linux(Ubuntu)下Mysql5.6.28安装配置方法图文教程

mysql5.6.28安装配置方法

1.系统基本信息查看,尝试yum安装

$ sudo -s
# df -lh
Filesystem  Size Used Avail Use% Mounted on
/dev/vda1  79G 1.6G 74G 3% /
udev   3.9G 8.0K 3.9G 1% /dev
tmpfs   799M 252K 799M 1% /run
none   5.0M  0 5.0M 0% /run/lock
none   3.9G  0 3.9G 0% /run/shm
# uname -a
Linux nj01 3.16.0-34-generic #47~14.04.1-Ubuntu SMP Fri Apr 10 17:49:16 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

# rpm -qa|grep yum
The program 'rpm' is currently not installed. You can install it by typing:
apt-get install rpm
# apt-get install rpm
……
# rpm -qa|grep yum
# yum install
The program 'yum' is currently not installed. You can install it by typing:
apt-get install yum
# apt-get install yum
……
# yum install mysql
Setting up Install Process
No package mysql available.
Nothing to do

2.更换安装方式

# apt-get install mysql-server
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following extra packages will be installed:
  libdbd-mysql-perl libdbi-perl libhtml-template-perl libmysqlclient18 libnet-daemon-perl libplrpc-perl libterm-readkey-perl mysql-client-5.5
  mysql-client-core-5.5 mysql-common mysql-server-5.5 mysql-server-core-5.5
Suggested packages:
  libipc-sharedcache-perl tinyca mailx
The following NEW packages will be installed:
  libdbd-mysql-perl libdbi-perl libhtml-template-perl libmysqlclient18 libnet-daemon-perl libplrpc-perl libterm-readkey-perl mysql-client-5.5
  mysql-client-core-5.5 mysql-common mysql-server mysql-server-5.5 mysql-server-core-5.5
0 upgraded, 13 newly installed, 0 to remove and 15 not upgraded.
Need to get 27.6 MB of archives.
After this operation, 98.2 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://apt.wmcloud.com/ubuntu/ precise-updates/main mysql-common all 5.5.52-0ubuntu0.12.04.1 [12.6 kB]
Get:2 http://apt.wmcloud.com/ubuntu/ precise-updates/main libmysqlclient18 amd64 5.5.52-0ubuntu0.12.04.1 [952 kB]
Get:3 http://apt.wmcloud.com/ubuntu/ precise/main libnet-daemon-perl all 0.48-1 [43.1 kB]
Get:4 http://apt.wmcloud.com/ubuntu/ precise/main libplrpc-perl all 0.2020-2 [36.0 kB]
Get:5 http://apt.wmcloud.com/ubuntu/ precise/main libdbi-perl amd64 1.616-1build2 [849 kB]
Get:6 http://apt.wmcloud.com/ubuntu/ precise/main libdbd-mysql-perl amd64 4.020-1build2 [106 kB]
Get:7 http://apt.wmcloud.com/ubuntu/ precise-updates/main mysql-client-core-5.5 amd64 5.5.52-0ubuntu0.12.04.1 [1,948 kB]
Get:8 http://apt.wmcloud.com/ubuntu/ precise/main libterm-readkey-perl amd64 2.30-4build3 [28.6 kB]
Get:9 http://apt.wmcloud.com/ubuntu/ precise-updates/main mysql-client-5.5 amd64 5.5.52-0ubuntu0.12.04.1 [8,365 kB]
Get:10 http://apt.wmcloud.com/ubuntu/ precise-updates/main mysql-server-core-5.5 amd64 5.5.52-0ubuntu0.12.04.1 [6,327 kB]
Get:11 http://apt.wmcloud.com/ubuntu/ precise-updates/main mysql-server-5.5 amd64 5.5.52-0ubuntu0.12.04.1 [8,855 kB]
Get:12 http://apt.wmcloud.com/ubuntu/ precise/main libhtml-template-perl all 2.10-1 [65.0 kB]
Get:13 http://apt.wmcloud.com/ubuntu/ precise-updates/main mysql-server all 5.5.52-0ubuntu0.12.04.1 [10.8 kB]
Fetched 27.6 MB in 0s (38.2 MB/s)   
Preconfiguring packages ...
Selecting previously unselected package mysql-common.
(Reading database ... 77501 files and directories currently installed.)
Unpacking mysql-common (from .../mysql-common_5.5.52-0ubuntu0.12.04.1_all.deb) ...
Selecting previously unselected package libmysqlclient18.
Unpacking libmysqlclient18 (from .../libmysqlclient18_5.5.52-0ubuntu0.12.04.1_amd64.deb) ...
Selecting previously unselected package libnet-daemon-perl.
Unpacking libnet-daemon-perl (from .../libnet-daemon-perl_0.48-1_all.deb) ...
Selecting previously unselected package libplrpc-perl.
Unpacking libplrpc-perl (from .../libplrpc-perl_0.2020-2_all.deb) ...
Selecting previously unselected package libdbi-perl.
Unpacking libdbi-perl (from .../libdbi-perl_1.616-1build2_amd64.deb) ...
Selecting previously unselected package libdbd-mysql-perl.
Unpacking libdbd-mysql-perl (from .../libdbd-mysql-perl_4.020-1build2_amd64.deb) ...
Selecting previously unselected package mysql-client-core-5.5.
Unpacking mysql-client-core-5.5 (from .../mysql-client-core-5.5_5.5.52-0ubuntu0.12.04.1_amd64.deb) ...
Selecting previously unselected package libterm-readkey-perl.
Unpacking libterm-readkey-perl (from .../libterm-readkey-perl_2.30-4build3_amd64.deb) ...
Selecting previously unselected package mysql-client-5.5.
Unpacking mysql-client-5.5 (from .../mysql-client-5.5_5.5.52-0ubuntu0.12.04.1_amd64.deb) ...
Selecting previously unselected package mysql-server-core-5.5.
Unpacking mysql-server-core-5.5 (from .../mysql-server-core-5.5_5.5.52-0ubuntu0.12.04.1_amd64.deb) ...
Processing triggers for man-db ...
Setting up mysql-common (5.5.52-0ubuntu0.12.04.1) ...
Selecting previously unselected package mysql-server-5.5.
(Reading database ... 77879 files and directories currently installed.)
Unpacking mysql-server-5.5 (from .../mysql-server-5.5_5.5.52-0ubuntu0.12.04.1_amd64.deb) ...
Selecting previously unselected package libhtml-template-perl.
Unpacking libhtml-template-perl (from .../libhtml-template-perl_2.10-1_all.deb) ...
Selecting previously unselected package mysql-server.
Unpacking mysql-server (from .../mysql-server_5.5.52-0ubuntu0.12.04.1_all.deb) ...
Processing triggers for ureadahead ...
Processing triggers for man-db ...
Setting up libmysqlclient18 (5.5.52-0ubuntu0.12.04.1) ...
Setting up libnet-daemon-perl (0.48-1) ...
Setting up libplrpc-perl (0.2020-2) ...
Setting up libdbi-perl (1.616-1build2) ...
Setting up libdbd-mysql-perl (4.020-1build2) ...
Setting up mysql-client-core-5.5 (5.5.52-0ubuntu0.12.04.1) ...
Setting up libterm-readkey-perl (2.30-4build3) ...
Setting up mysql-client-5.5 (5.5.52-0ubuntu0.12.04.1) ...
Setting up mysql-server-core-5.5 (5.5.52-0ubuntu0.12.04.1) ...
Setting up mysql-server-5.5 (5.5.52-0ubuntu0.12.04.1) ...
160928 10:56:48 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
160928 10:56:48 [Note] /usr/sbin/mysqld (mysqld 5.5.52-0ubuntu0.12.04.1) starting as process 6166 ...
mysql start/running, process 6304
Setting up libhtml-template-perl (2.10-1) ...
Setting up mysql-server (5.5.52-0ubuntu0.12.04.1) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place

安装过程中输入root的密码即可;

3.安装成功,基本配置

mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' identified by '******';
Query OK, 0 rows affected (0.00 sec)

mysql>
mysql>
mysql>
mysql>
mysql>
mysql> create database testdb;
Query OK, 1 row affected (0.01 sec)

mysql>
mysql>
mysql>
mysql>
mysql> show databases;
+--------------------+
| Database   |
+--------------------+
| information_schema |
| mysql    |
| testdb    |
| performance_schema |
+--------------------+
4 rows in set (0.00 sec)

mysql> insert into mysql.user(Host,User,Password) values("%","test",password("******"));
Query OK, 1 row affected, 3 warnings (0.00 sec)

mysql>
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON testdb.* TO 'test'@'% identified by '******';
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

4.问题解决

(1)访问报错,网络连接报错:10038 ,telnet 不通
S1.关闭防火墙 # ufw allow 3306 ,还是不行
S2.用户网络权限已经给了(rant all privileges on . to ‘root'@'%' identified by ‘youpassword' with grant option;)
S3.查看网路信息 # netstat -ano
tcp 0 0 127.0.0.1:3306
应该是绑定IP问题,修改/etc/MySQL/my.conf
找到bind-address = 127.0.0.1这一行
改为bind-address = 0.0.0.0,问题解决。
(2)表区分大小写:
用root帐号登录后,在/etc/my.cnf 中的[mysqld]后添加添加lower_case_table_names=1,重启MYSQL服务,这时已设置成功:不区分表名的大小写;
lower_case_table_names参数详解:
lower_case_table_names = 0
其中 0:区分大小写,1:不区分大小写

5.基本服务命令

# 启动MySQL$ sudo service mysql start
# 关闭MySQL$ sudo service mysql stop
# 重启MySQL$ sudo service mysql restart
# 其他命令:$ sudo /etc/init.d/mysql start
$ sudo /etc/init.d/mysql stop
$ sudo /etc/init.d/mysql restart

6.卸载Mysql:

sudo apt-get autoremove mysql* --purge
sudo apt-get remove apparmor
sudo apt-get install mysql-server mysql-common

卸载后删除mysql相关文件(/var/lib/mysql , /etc/mysql等等,可以用 find -name mysql 查询下相关路径)

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持我们。

(0)

相关推荐

  • Linux下安装mysql-5.6.4 的图文教程

    在开始安装前,先说明一下mysql-5.6.4与较低的版本在安装上的区别,从mysql-5.5起,mysql源码安装开始使用cmake了,因此当我们配置安装目录./configure --perfix=/.....的时候和以前的会有些区别,这点我们稍后会提到. 一:解压缩mysql-5.6.4-m7-tar.zip 1>  unzip mysql-5.6.4-m7-tar.zip   会生成mysql-5.6.4-m7-tar.gz的压缩文件 2> tar -zxvf mysql-5.6.4-

  • 详解Lamp环境搭建Linux CentOS6.5编译安装mysql5.6

    安装前准备 通过rpm命令检查centos上是否已经安装mysql,然后卸载已经存在的mysql版本 [root@localhost src]# rpm -qa|grep mysql mysql-libs-5.1.66-2.el6_3.i686 [root@localhost src]# rpm -e --nodeps mysql-libs-5.1.66-2.el6_3.i686 通过yum安装mysql编译需要的依赖包 [root@localhost src]# yum install gcc

  • linux二进制通用包安装mysql5.6.20教程

    我们使用二进制通用包安装MySQL,这个类似于windows下的绿色软件,解压后配置即可使用,下载地址: https://edelivery.Oracle.com/EPD/Search/handle_go 2.将二进制mysql安装文件解压到/usr/local下,这里使用软连接为mysql [root@mysql1 soft]tar xvf mysql-advanced-5.6.20-linux-glibc2.5-x86_64.tar.gz -C /usr/local [root@mysql1

  • Linux下mysql5.6.33安装配置教程

    本教程为大家分享了mysql5.6.33在linux下的安装配置方法,供大家参考,具体内容如下 1.下载 下载地址:http://dev.mysql.com/downloads/mysql/5.6.html#downloads 下载版本:我这里选择的5.6.33,通用版,linux下64位 也可以直接复制64位的下载地址,通过命令下载: 复制代码 代码如下: wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.33-linux-

  • linux CentOS6.5 yum安装mysql5.6

    本文为大家分享了linux yum安装mysql5.6简单过程,供大家参考,具体内容如下 1.新开的云服务器,需要检测系统是否自带安装mysql # yum list installed | grep mysql 2.如果发现有系统自带mysql,果断这么干 # yum -y remove mysql-libs.x86_64 3.随便在你存放文件的目录下执行,这里解释一下,由于这个mysql的yum源服务器在国外,所以下载速度会比较慢,还好 mysql5.6只有79M大,而mysql5.7就有1

  • linux下源码安装mysql5.6.20教程

    linux下MySQL 5.6源码安装记录如下 1.下载:当前mysql版本到了5.6.20 http://dev.mysql.com/downloads/mysql 选择Source Code 2.必要软件包 复制代码 代码如下: yum -y install  gcc gcc-c++ gcc-g77 autoconf automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel* make cmake 3.编

  • linux mysql5.6版本的安装配置过程

    从今年3月份开始mysql官网开始发布相关的5.6系列的各个版本,对于mysql5.6系列的版本对一起的版本进行了全局性的细节性加强:个人感觉,以下是在虚拟机中配置的mysql5.6.10源码安装的过程分享记录下: [root@mysql5 ~]# groupadd mysql [root@mysql5 ~]# useradd -r -g mysql mysql [root@mysql5 ~]# ls anaconda-ks.cfg install.log install.log.syslog

  • Linux安装MySQL5.6.24使用文字说明

    Linux安装MySQL笔记 1.在安装MySQL数据库服务器前,确保你的linux系统是可以连接网络的,下面我们将通过源码方式来安装mysql首先通过putty登入进你的Linux系统,确保系统中已经安装的gcc c++ 等编译环境,因为mysql从5.5版本开始是使用cmake编译的,如果三个环境都没安装,可以使用下面的命令进行安装:yum -y install make gcc-c++ cmake bison-devel ncurses-devel 2.查找系统里是否已经安装了mysql数

  • Linux下MySQL 5.6.27 安装教程

    本文实例为大家分享了Linux下MySQL 5.6.27 安装教程,供大家参考,具体内容如下 1.下载地址 https://cdn.mysql.com/archives/mysql-5.6/mysql-5.6.27-linux-glibc2.5-x86_64.tar.gz 2.将压缩包上传到服务器 3.解压 tar -zxf mysql-5.6.27-linux-glibc2.5-x86_64.tar.gz 4.移动压缩包至mysql文件夹下 mp  mysql-5.6.27-linux-gli

  • Linux(Ubuntu)下Mysql5.6.28安装配置方法图文教程

    mysql5.6.28安装配置方法 1.系统基本信息查看,尝试yum安装 $ sudo -s # df -lh Filesystem Size Used Avail Use% Mounted on /dev/vda1 79G 1.6G 74G 3% / udev 3.9G 8.0K 3.9G 1% /dev tmpfs 799M 252K 799M 1% /run none 5.0M 0 5.0M 0% /run/lock none 3.9G 0 3.9G 0% /run/shm # uname

  • Linux(Ubuntu)下mysql5.7.17安装配置方法图文教程

    前言 前面安装过mysql5.6,时隔三个月,开发那边反馈需要在MySQL中处理JSON类型的数据,查看文档,JSON是在5.7支持的新特性.于是着手安装Mysql57 Mysql5.6.28的安装:http://www.jb51.net/article/103743.htm 安装 若使用apt-get install mysql-server进行安装,默认安装的不是最新的版本,于是考虑去官网找一个最新的社区版本. 1.获取最新的Mysql版本 在 https://dev.mysql.com/d

  • Windows下mysql5.7.10安装配置方法图文教程

    MySQL针对不同的用户提供了2种不同的版本: MySQL Community Server:社区版.由MySQL开源社区开发者和爱好者提供技术支持,对开发者开放源代码并提供免费下载.MySQL Enterprise Server:企业版.包括最全面的高级功能和管理工具,不过对用户收费. 下面讲到的MySQL安装都是以免费开源的社区版为基础.打开MySQL数据库官网的下载地址,上面提供了两种安装文件,一种是直接安装的MSI安装文件,另一种是需要解压并配置的压缩包文件.我这里用的是5.7.10版本

  • Linux虚拟机下mysql 5.7安装配置方法图文教程

    记录一下Linux虚拟机下MySQL安装配置方法 一. 下载mysql5.7 http://mirrors.sohu.com/mysql/MySQL-5.7/ Linux下载: 输入命令:wget http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz 二.建立用户,以及mysql的目录 1.建立一个mysql的组 输入命令: groupadd mysql 2.建立mysql用户,并放到m

  • win7下mysql5.7.17安装配置方法图文教程

    win7下安装MySQL5.7.17图文教程,分享给大家. 1.下载安装包 请在以下https://dev.mysql.com/downloads/mysql/ 有ZIP包和MSI两种类型包,建议新手选择ZIP包下载,有助于熟习MySQL 2.解压MySQL压缩包 下载完成后解压,将其放在要安装的目录下面,如:E:\Mysql\mysql-5.7.17-win32 3.创建并修改配置文件my.ini 在对应的安装目录下新建my.ini文件,可以复制一个my-default.ini的副本并修改文件

  • Mac OS10.11下mysql5.7.12 安装配置方法图文教程

    Mac OS10.11安装和配置MySQL,主要是图,步骤我简单说明一下. 首先访问mysql官网并下载安装程序,当然在下载之前你需要线注册下账号. 网站地址:MySQL下载页面,下载两个安装程序:MySQL Community Server.MySQL Workbench. MySQL Community Server 点击进入下载页面,在页面最下方,有下载选项,请确认选择的平台是Mac OS X,然后下载下图用红框划出的安装包.下载时需要登录帐号. 下载后运行,直接运行mysql.pkg,在

  • centos6.4下mysql5.7.18安装配置方法图文教程

    centos6.4下安装mysql5.7.18的具体步骤,分享给大家. 1.首先检查是否已经安装过mysql,查找mysql相关软件rpm包 #rpm -qa | grep mysql 2.将所有与mysql相关的东西删除 #yum -y remove mysql-libs-5.1.66-2.el6_3.x86_64 3.安装依赖包 #yum -y install make gcc-c++ cmake bison-devel ncurses-devellibaio libaio-devel 4.

  • Windows下mysql 8.0.28 安装配置方法图文教程

    本文为大家分享了Windows下mysql 8.0.28 安装配置方法图文教程,供大家参考,具体内容如下 本教程只针对于8.0版本及以上的版本5.0版本不能以这方法安装 第一步:先去MySql官网下载8.0.28的安装包MySQL :: Download MySQL Community Server 或点击这里下载 推荐下载第一个 第二步:解压在本地盘符 创建my.ini配置文件,因为下面会有控制台创建data文件,所以在这里不要自己创建data文件夹,不要自己创建data文件夹,不要自己创建d

  • mysql5.7.20 安装配置方法图文教程(mac)

    mysql5.7.20 安装配置方法图文教程,为大家分享 1.官网:https://dev.mysql.com/downloads/mysql/下载 强烈建议选择dmg文件下载,下载tar版本解压之后需要将文件夹移至默认安装位置/usr/local,还需要各种配置实在是麻烦~ 2.双击pkg文件进行安装,一路继续,直至弹出如下界面: 图中红色框内的部分即是mysql安装后的初始密码,请记住 3.打开系统"偏好设置",点击下面的mysql图标 进入mysql的控制台,在这里你可以开启或者

  • mysql 8.0.28 安装配置方法图文教程

    mysql 8.0.28版本安装配置方法图文教程,供大家参考,具体内容如下 从 Mysql 官网下载 mysql 或直接点击这里下载 下载完成后直接双击进行安装,打开后的页面如下所示: 选择自定义custom,接着下一步 将MySQL Server 展开,添加到右边(点击绿色箭头) 选择安装位置后点击ok 点击Next,点击MySQL Sever,选择后再点击Execute 下载完成后点击下一步(需要等待一小会儿) 直接下一步 下一步 一般情况下选择第二个即可,然后点击下一步 设置密码,设置的密

随机推荐