Ubuntu18.04安装mysql5.7
Ubuntu18.04安装mysql5.7
1.1安装
首先执行下面三条命令:
# 安装mysql服务
sudo apt-get install mysql-server
# 安装客户端
sudo apt install mysql-client
# 安装依赖
sudo apt install libmysqlclient-dev
# 检查状态
sudo netstat -tap | grep mysql
1.2设置root密码
mysql5.7安装完成后普通用户不能进mysql,原因:root的plugin被修改成了auth_socket,用密码登陆的plugin应该是mysql_native_password,直接用root权限登录就不用密码,修改root密码和登录验证方式:
$ sudo su
# mysql
mysql>
mysql> select user, plugin from mysql.user;
+------------------+-----------------------+
| user | plugin |
+------------------+-----------------------+
| root | auth_socket |
| mysql.session | mysql_native_password |
| mysql.sys | mysql_native_password |
| debian-sys-maint | mysql_native_password |
+------------------+-----------------------+
rows in set (0.00 sec)
mysql> update mysql.user set authentication_string=PASSWORD(''), plugin='mysql_native_password' where user='root';
mysql> flush privileges;
mysql> exit
Bye
# exit
$ sudo /etc/init.d/mysql restart
$ mysql -uroot -p Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.7.-0ubuntu18.04.1 (Ubuntu) Copyright (c) , , 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>
1.3配置mysql远程登录
# 修改配置文件,注释掉bind-address = 127.0.0.1
$ sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf # 保存退出,然后进入mysql服务,执行授权命令:
$ mysql -uroot -p mysql> grant all on *.* to root@'%' identified by '' with grant option;
Query OK, rows affected, warning (0.00 sec) mysql> flush privileges;
Query OK, rows affected (0.00 sec) mysql> exit
Bye
$ sudo /etc/init.d/mysql restart
转自:https://blog.csdn.net/lynnyq/article/details/80296137
Ubuntu18.04安装mysql5.7的更多相关文章
- ubuntu18.04 安装hadoop 2.7.3+hive 2.3.4
1. 安装hadoop 详细请参见本人的另外一片博文<Hadoop 2.7.3 分布式集群安装> 2. 下载hive 2.3.4 解压文件到/opt/software -bin.tar.g ...
- Ubuntu18.04安装RabbitMQ
Ubuntu18.04安装RabbitMQ 2018年06月10日 19:32:38 dmfrm 阅读数:2492 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog ...
- ubuntu18.04 安装mysql不出现设置 root 帐户的密码问题(装)
ubuntu18.04 安装mysql不出现设置 root 帐户的密码问题 https://blog.csdn.net/NeptuneClouds/article/details/80995 ...
- Ubuntu18.04安装Virtualenv虚拟环境
在Ubuntu18.04安装Virtualenv虚拟环境 [实验环境]: 在这台电脑上已经安装了python3 [安装参考] 1.查看是否已安装virtualenv virtualenv --vers ...
- Ubuntu18.04安装thunderbird并设置中文
Ubuntu18.04安装thunderbird并设置中文 安装thunderbird sudo apt-get install thunderbird 安装中文包 sudo apt-get inst ...
- Ubuntu18.04安装Docker, centos7安装Docker
Ubuntu18.04安装Docker 第一种方法从Ubuntu的仓库直接下载安装: 安装比较简单,这种安装的Docker不是最新版本,不过对于学习够用了,依次执行下面命令进行安装. $ sudo a ...
- Ubuntu18.04安装和配置Java JDK11并卸载自带OpenJDK
卸载自带的OpenJDK方法: 在终端执行命令:sudo apt-get remove openjdk* Ubuntu18.04安装JDK11.0.2 前面步骤一样,可参考:https://www.c ...
- Ubuntu18.04 安装 oh-my-zsh
目录 Ubuntu18.04 安装 oh-my-zsh 目录 安装zsh 安装curl 安装oh-my-zsh 使用zsh替换bash 修改终端主题和配色 修改终端配置 隐藏用户和主机名 效果图 Ub ...
- Ubuntu18.04 安装MySQL(Linux)解决登陆权限问题及Navicat for mysql 中文乱码问题
一.MySQL(Linux)解决登陆权限问题 Ubuntu18.04 安装mysql或者mariadb之后,发现普通用户和远程都没有权限连接. ERROR 1045: Access denied fo ...
随机推荐
- 只有 assignment、call、increment、decrement 和 new 对象表达式可用作语句
错误信息:只有 assignment.call.increment.decrement 和 new 对象表达式可用作语句: 分析:发生这种情况一般是在赋值时把“=”写成了“==”,例如:textBox ...
- UVA215-Spreadsheet Calculator(模拟+拓扑排序)
Problem UVA215-Spreadsheet Calculator Accept:401 Submit:2013 Time Limit: 3000 mSec Problem Descript ...
- WIN10 企业版 LTSC 激活
Windows10 企业版长期服务支持分支版本: Windows 10 LTSC 2019 WIN+X 选POWERSHELL 管理员版本 输入以下 slmgr -ipk M7XTQ-FN8P6-TT ...
- [HEOI2016/TJOI2016]排序
嘟嘟嘟 首先这题的暴力是十分好写的,而且据说能得不少分. 正解写起来不难,就是不太好想. 根据做题经验,我想到了给这个序列转化成01序列,但是接下来我就不会了.还是看了题解. 因为查询只有一个数,所以 ...
- P1145 约瑟夫 W(模拟)
暴力+模拟 #include<iostream> #include<cstring> using namespace std; int ans, k, k2; ]; bool ...
- mysql之grant权限说明
mysql中给一个用户授权如select,insert,update,delete等其中的一个或者多个权限,主要使用grant命令,格式为: 给没有用户授权 grant 权限 on 数据库对象 to ...
- layui之日期和时间组件
参考文档:https://www.layui.com/doc/modules/laydate.html代码片段如下: layui.use('laydate', function(){ var layd ...
- Matconvnet笔记(一)
参考网址:http://www.vlfeat.org/matconvnet/ 内容参考博客:http://blog.sina.com.cn/s/blog_92cd3a1c0102x1ch.html M ...
- RPC通信原理(未完,先睡觉)
一 背景 OpenStack 各组件之间是通过 REST 接口进行相互通信,比如Nova.Cinder.Neutron.Glance直间的通信都是通过keystone获取目标的endpoint,即ap ...
- Java调用FFmpeg进行视频处理及Builder设计模式的应用
1.FFmpeg是什么 FFmpeg(https://www.ffmpeg.org)是一套可以用来记录.转换数字音频.视频,并能将其转化为流的开源计算机程序.它用来干吗呢?视频采集.视频格式转化.视频 ...