#手下下载tar.gz包
#首先手工建立mysql用户和用户组
 > groupadd mysql
 > useradd -r -g mysql mysql
#然后就是安装的解压 编译安装
 > tar zxvf mysql-5.6.10.tar.gz
 > cd mysql-5.6.10
 > cmake .
 > make -j 2
 > make install

#然后就是一些权限的配置 服务的启动
 > cd /usr/local/mysql
 > chown -R mysql .
 > chgrp -R mysql .
 > scripts/mysql_install_db --user=mysql
 > chown -R root .
 > chown -R mysql data
#将mysql配置文件拷贝到etc目录(全局配置)
 > cp support-files/my-default.cnf /etc/my.cnf
#启动mysql
 > bin/mysqld_safe --user=mysql &
# 复制mysql.server脚本到/etc/init.d(初始化服务)
 > cp support-files/mysql.server /etc/init.d/mysql.server

#启动mysql

> bin/mysqld_safe --user=mysql &

#初始化mysql root用户密码

> bin/mysqladmin -u root password '密码文字'

#查看mysql运行状态

sudo service mysql.server status

#如果显示 not running,应该是前面没有启动服务,可直接用service mysql.server start启动

sudo service mysql.server [status|start|stop]

#让mysql开机启动[defaults],取消开机启动[remove]

sudo update-rc.d -f mysql.server defaults [remove]

#将mysql/bin/mysql命令加入到用户命令中,或将mysql/bin目录加入path

加入用户命令:

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

加入环境变量:

export PATH=$PATH:/usr/local/mysql/bin

#允许root用户远程登录

1>进入mysql: mysql –u root –p

2>改变数据库: use mysql;

3>从任意主机登录: grant all privileges on *.* to root@"%" identified by "密码文字" with grant option;

4>从指定主机登录: grant all privileges on *.* to root@"192.168.1.101" identified by "passw0rd" with grant option;

5>授权生效: flush privileges;

6>查看host为%授权是否添加: select * from user;

> mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 5.6.15 Source distribution

Copyright (c) 2000, 2013, 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>

熟悉的窗口啊

Ubunton安装mysql的更多相关文章

  1. Centos6.5下编译安装mysql 5.6

    一:卸载旧版本 使用下面的命令检查是否安装有MySQL Server rpm -qa | grep mysql 有的话通过下面的命令来卸载掉 rpm -e mysql //普通删除模式 rpm -e ...

  2. 在Ubuntu 16.10安装mysql workbench报未安装软件包 libpng12-0错误

    1.安装mysql workbench,提示未安装软件包 libpng12-0 下载了MySQL Workbench 6.3.8   在安装的时候报错: -1ubu1604-amd64.deb 提示: ...

  3. ubuntu安装mysql

    好记性不如烂笔头,记录一下,ubuntu安装mysql的指令. 安装MySQL: sudo apt-get install mysql-server sudo apt-get install mysq ...

  4. Linux1 在Linux(CentOS)上安装MySql详细记录

    前记:  毕业两年了,前两天换了份工作,由以前的传统行业跳到了互联网行业.之前的公司一直在用WinServer2003+Tomcat+SqlServer/Oracle这套部署环境.对于Linux+To ...

  5. PHP安装mysql.so扩展

    在PHP中mysql_connect模块已经逐渐被弃用,我在搭建环境时也没有再安装mysql扩展,但是今天在维护一个老项目时,出现报错 Fatal error: Uncaught Error: Cal ...

  6. 安装MySql for Visual Studio的坑

    阅读目录 问题描述 解决过程 解决方案 总结 回到顶部 问题描述 安装MySql for Visual Studio 一般来说是为了能在VS的服务器数据连接的数据源中能选择MySql类型,如下图: 但 ...

  7. CentOS 7 安装MySQL 5.6遇到的疑难杂症小结

    在一测试服务器(CentOS Linux release 7.2.1511)上安装MySQL 5.6(5.6.19 MySQL Community Server)时遇到下面错误,这个是因为CentOS ...

  8. Mac上安装MySQL记录

    下载最新的MySQL社区版 官方下载地址:http://dev.mysql.com/downloads/mysql/ 为了安装更方便,建议下载dmg安装包. 最新的版本是5.7.9. 安装MySQL ...

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

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

随机推荐

  1. Ajax异步提交造成变量undefined

    在使用jQuery的get方法或post方法向后台发ajax请求时,在其中定义一个变量htmlcollectionlst,但是在循环结束后却发现是undifined $.get("GetPl ...

  2. 算法之LOWB三人组之冒泡排序

    排序 冒泡排序(Bubble Sort)时间复杂度为O(n^2) 列表每两个相邻的数,如果前面比后面大,则交换这两个数 一趟排序完成后,则无序区减少一个数,有序区增加一个数. def bubble_s ...

  3. js回调函数,检测这个值是否重复

    //校验提交的数据是否重复 /** * url:后端的查询地址 * filedVal: 要传到后台的值 * ele:要绑定显示的元素,一般就是当前的input就可以,直接在其后边追加显示 * fn:回 ...

  4. Shell教程 之printf命令

    上一章节我们学习了 Shell 的 echo 命令,本章节我们来学习 Shell 的另一个输出命令 printf. printf 命令模仿 C 程序库(library)里的 printf() 程序. ...

  5. sourceforge

    sourceforge SourceForge.net,又称SF.net,是开源软件开发者进行开发管理的集中式场所. SourceForge.net由VA Software提供主机,并运行Source ...

  6. Git之生成SSH公钥

    一 生成公钥 ssh-keygen -t rsa -C "michelangelo@qq.com" -t :密钥类型. -C :  注释.通常用作密钥的名字. 依次按三次回车:默认 ...

  7. leetcode 443. String Compression

    下面反向遍历,还是正向好. void left(vector<char>& v, bool p(int)) { ; ; ; while (del < max_index) { ...

  8. robotium—只有apk文件的测试

    把ppt的内容总结一下,并把问题说明一下: 把基本步骤搞出来,用notepad的程序吧,直接安装apk,就当做是不知道源码就好啦! 直接用自己的手机上就行啦!! 一.重签名: 步骤: 1.直接运行re ...

  9. 【nginx】配置详解

    nginx作为web server,是最常用的网络服务器.来看下它的配置文件. 实验1:最基础的配置(可访问静态资源) 包括listen,server_name,root,index,access_l ...

  10. 常用的key和oid

    1.FortiGate Template-Network-Office-Fortigate-Session Count:key,fgSysSesCount   oid,.1.3.6.1.4.1.123 ...