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 查询下相关路径)

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

时间: 2024-10-24 18:12:43

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

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

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

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,在

win7下MySql 5.7安装配置方法图文教程_Mysql

上学的时候经常使用MySql,当时也没想其他,主要是MySql对电脑的要求比较低,负载比较小.工作后一直在使用Oracle,现在因为项目的需要,重新安装MySql,发现变化有点多. 本经验适用于安装MySql最新版本数据库. 具体实现步骤: 下载MySql,作者通过度娘搜索MySql,找到文件mysql-installer-community-5.7.3.0-m13.2063434697.msi,虽然这一个文件比较大,但是不用我们可以的区分64位还是32位,如图 双击安装包,会出现安装前准备,当

mysql 5.7.13 winx64安装配置方法图文教程(win10)

本文实例为大家分享了mysql 5.7.13 winx64安装配置方法图文教程,供大家参考,具体内容如下 下载 地址:http://dev.mysql.com/downloads/file/?id=463242 安装 1.解压下载好的mysql-5.7.13-winx64.zip到你需要安转的目录(eg:D:\mysql): 2.配置解压目录下的my_default.ini中命名为my.ini 作相关的配置如下: # These are commonly set, remove the # an

Tomcat安装配置方法图文教程_Tomcat

用来进行web开发的工具有很多,Tomcat是其中一个开源的且免费的java Web服务器,是Apache软件基金会的项目.电脑上安装配置Tomcat的方法和java有些相同,不过首先需要配置好java的环境才行,点击此文查看:java环境变量如何配置. 接下来安装配置Tomcat: 1.下载Tomcat文件,文件是一个exe的安装文件,下载后直接安装即可. 下载地址在百度输入Tomcat进入官网即可找到下载文件.安装文件没有什么技巧,一直点击下一步即可. 2.同样安装时注意安装目录,因为一会要

MAC下mysql安装配置方法图文教程_Mysql

一.下载MySQL     访问MySQL的官网http://www.mysql.com/downloads/ 然后在页面中会看到"MySQL Community Server"下方有一个"download"点击. 进入MySQL的下载界面(http://www.mysql.com/downloads/mysql/),如果你是用的Mac OS来访问的话那么就会默认为你选好了Mac OS X 平台,而下面罗列的都是在Mac OS上能用的MySQL的版本,如果是用的其他

Windows下MySQL安装配置方法图文教程_Mysql

Windows下的安装与配置MySQL详细步骤思路,分享给大家,供大家参考,具体内容如下 本文介绍Windows XP下的安装与配置. 要想在Windows中运行MySQL,需要: Ø 32位Windows操作系统,例如9x.Me.NT.2000.XP或Windows Server 2003. 基于Windows NT的操作系统(NT,2000,XP,2003),将MySQL服务器做为服务来运行.强烈建议使用基于Windows NT的操作系统. Ø TCP/IP协议支持(也许是所有数据库系统的基

mysql 5.7.13 winx64安装配置方法图文教程_Mysql

针对之前安装mysql的笔记进行了总结,分享给大家. 1.下载 下载地址:http://dev.mysql.com/downloads/mysql/ 根据电脑配置来选,我选了 windows(x86,64-bit),ZIP Archive这个,点击Download,页面跳转到如下图 点击最下面的No thanks,just start my download,开始下载. 我的mysql安装路径是D:\Mysql\mysql-5.7.13-winx64 2.配置my.ini文件,新增data文件夹

mysql 5.7.11 winx64安装配置方法图文教程_Mysql

在64位Windows7操作系统上安装和配置MySql数据库系统. 一.mysql5.7.11 winx64安装配置方法 步骤: 1.官网下载MySQL数据库和驱动程序(Windows):mysql-5.7.11-winx64.zip 2.创建数据库配置文件:my.ini Example: 1.解压压缩包至:D:\Program Files 2.创建 D:\Program Files\mysql-5.7.11-winx64\my.ini 配置文件 3.初始化和启动Mysql服务: 1.以管理员权