Ubunton安装mysql
#手下下载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的更多相关文章
- Centos6.5下编译安装mysql 5.6
一:卸载旧版本 使用下面的命令检查是否安装有MySQL Server rpm -qa | grep mysql 有的话通过下面的命令来卸载掉 rpm -e mysql //普通删除模式 rpm -e ...
- 在Ubuntu 16.10安装mysql workbench报未安装软件包 libpng12-0错误
1.安装mysql workbench,提示未安装软件包 libpng12-0 下载了MySQL Workbench 6.3.8 在安装的时候报错: -1ubu1604-amd64.deb 提示: ...
- ubuntu安装mysql
好记性不如烂笔头,记录一下,ubuntu安装mysql的指令. 安装MySQL: sudo apt-get install mysql-server sudo apt-get install mysq ...
- Linux1 在Linux(CentOS)上安装MySql详细记录
前记: 毕业两年了,前两天换了份工作,由以前的传统行业跳到了互联网行业.之前的公司一直在用WinServer2003+Tomcat+SqlServer/Oracle这套部署环境.对于Linux+To ...
- PHP安装mysql.so扩展
在PHP中mysql_connect模块已经逐渐被弃用,我在搭建环境时也没有再安装mysql扩展,但是今天在维护一个老项目时,出现报错 Fatal error: Uncaught Error: Cal ...
- 安装MySql for Visual Studio的坑
阅读目录 问题描述 解决过程 解决方案 总结 回到顶部 问题描述 安装MySql for Visual Studio 一般来说是为了能在VS的服务器数据连接的数据源中能选择MySql类型,如下图: 但 ...
- CentOS 7 安装MySQL 5.6遇到的疑难杂症小结
在一测试服务器(CentOS Linux release 7.2.1511)上安装MySQL 5.6(5.6.19 MySQL Community Server)时遇到下面错误,这个是因为CentOS ...
- Mac上安装MySQL记录
下载最新的MySQL社区版 官方下载地址:http://dev.mysql.com/downloads/mysql/ 为了安装更方便,建议下载dmg安装包. 最新的版本是5.7.9. 安装MySQL ...
- linux 安装mysql数据库——yum安装法
mysql数据库有多种安装方式,本文只介绍在Linux服务器上最实用.最快捷的mysql server安装方法.一.Linux服务器yum安装(CentOS6.3 64位) 所有在服务器上执行的命令, ...
随机推荐
- KMP与AC自动机模板
HDU 1711 Number Sequence(KMP模板题) http://acm.hdu.edu.cn/showproblem.php?pid=1711 #include<bits/std ...
- Realtime Rendering 1.1
[Realtime Rendering 1.1] 1.A linear transform is one that preserves vector addition and scalar multi ...
- Using Service Workers
[Using Service Workers] 1.This is an experimental technology Because this technology's specification ...
- Opengl库函数列表
http://www.cnblogs.com/GameDeveloper/archive/2012/01/07/2315867.html
- Idea设置类注释模板
1.选择File–>Settings–>Editor–>File and Code Templates–>Includes–>File Header. 在Descript ...
- 激活 pycharm
step1: 在本地 hosts 文件增加一行,windows 路径一般为:C:\Windows\System32\drivers\etc step2: 输入激活码 7SPIY8PDT7-eyJsaW ...
- centos 7 下 TFTP服务器安装
一.介绍 TFTP(Trivial File Transfer Protocol,简单文件传输协议)),是一个基于UDP 协议 69端口 实现的用于在客户机和服务器之间进行简单文件传输的协议提供不复杂 ...
- LibreOJ 6281 数列分块入门5
题目链接:https://loj.ac/problem/6281 参考博客:https://blog.csdn.net/qq_36038511/article/details/79725027 我一开 ...
- APP内的H5页面测试方法, 移动端的浏览器(例如UC浏览器)测试方法
前言: 用appium做UI自动化,测试APP里面的H5和测试手机浏览器打开的H5的操作流程上是有所区别的.比如要测试APP内嵌的H5需要先操作appium启动APP,然后通过context切到web ...
- 微信小程序开发-rem转换rpx小工具
实现原理: 对样式进行格式化,然后根据 “rem” 进行拆分,这样就会拆分成一个数组 [str1,str2,str3...,str6], 除了最后一个元素,前边的元素都会以 “rem” 样式的数值结尾 ...