Ubungu 18.04安装MySQL 5.7.24
Ubuntu 18.04,mysql Ver 14.14 Distrib 5.7.24, for Linux (x86_64),
USERNAME@USERNAME-VirtualBox:~$ sudo apt-get install -y mysql-server mysql-client
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libaio1 libevent-core-2.1-6 libhtml-template-perl mysql-client-5.7
mysql-client-core-5.7 mysql-server-5.7 mysql-server-core-5.7
Suggested packages:
libipc-sharedcache-perl mailx tinyca
The following NEW packages will be installed:
libaio1 libevent-core-2.1-6 libhtml-template-perl mysql-client mysql-client-5.7
mysql-client-core-5.7 mysql-server mysql-server-5.7 mysql-server-core-5.7
0 upgraded, 9 newly installed, 0 to remove and 204 not upgraded.
Need to get 20.4 MB of archives.
After this operation, 160 MB of additional disk space will be used.
Get:1 http://cn.archive.ubuntu.com/ubuntu bionic/main amd64 libaio1 amd64 0.3.110-5 [6,448 B]
Get:2 http://cn.archive.ubuntu.com/ubuntu bionic-updates/main amd64 mysql-client-core-5.7 amd64 5.7.24-0ubuntu0.18.04.1 [6,988 kB]
Get:3 http://cn.archive.ubuntu.com/ubuntu bionic-updates/main amd64 mysql-client-5.7 amd64 5.7.24-0ubuntu0.18.04.1 [2,312 kB]
Get:4 http://cn.archive.ubuntu.com/ubuntu bionic-updates/main amd64 mysql-server-core-5.7 amd64 5.7.24-0ubuntu0.18.04.1 [7,777 kB]
Get:5 http://cn.archive.ubuntu.com/ubuntu bionic/main amd64 libevent-core-2.1-6 amd64 2.1.8-stable-4build1 [85.9 kB]
Get:6 http://cn.archive.ubuntu.com/ubuntu bionic-updates/main amd64 mysql-server-5.7 amd64 5.7.24-0ubuntu0.18.04.1 [3,193 kB]
Get:7 http://cn.archive.ubuntu.com/ubuntu bionic/main amd64 libhtml-template-perl all 2.97-1 [59.0 kB]
Get:8 http://cn.archive.ubuntu.com/ubuntu bionic-updates/main amd64 mysql-client all 5.7.24-0ubuntu0.18.04.1 [9,828 B]
Get:9 http://cn.archive.ubuntu.com/ubuntu bionic-updates/main amd64 mysql-server all 5.7.24-0ubuntu0.18.04.1 [9,948 B]
Fetched 20.4 MB in 8s (2,540 kB/s)
Preconfiguring packages ...
Selecting previously unselected package libaio1:amd64.
(Reading database ... 156461 files and directories currently installed.)
Preparing to unpack .../0-libaio1_0.3.110-5_amd64.deb ...
Unpacking libaio1:amd64 (0.3.110-5) ...
Selecting previously unselected package mysql-client-core-5.7.
Preparing to unpack .../1-mysql-client-core-5.7_5.7.24-0ubuntu0.18.04.1_amd64.deb ...
Unpacking mysql-client-core-5.7 (5.7.24-0ubuntu0.18.04.1) ...
Selecting previously unselected package mysql-client-5.7.
Preparing to unpack .../2-mysql-client-5.7_5.7.24-0ubuntu0.18.04.1_amd64.deb ...
Unpacking mysql-client-5.7 (5.7.24-0ubuntu0.18.04.1) ...
Selecting previously unselected package mysql-server-core-5.7.
Preparing to unpack .../3-mysql-server-core-5.7_5.7.24-0ubuntu0.18.04.1_amd64.deb ...
Unpacking mysql-server-core-5.7 (5.7.24-0ubuntu0.18.04.1) ...
Selecting previously unselected package libevent-core-2.1-6:amd64.
Preparing to unpack .../4-libevent-core-2.1-6_2.1.8-stable-4build1_amd64.deb ...
Unpacking libevent-core-2.1-6:amd64 (2.1.8-stable-4build1) ...
Selecting previously unselected package mysql-server-5.7.
Preparing to unpack .../5-mysql-server-5.7_5.7.24-0ubuntu0.18.04.1_amd64.deb ...
Unpacking mysql-server-5.7 (5.7.24-0ubuntu0.18.04.1) ...
Selecting previously unselected package libhtml-template-perl.
Preparing to unpack .../6-libhtml-template-perl_2.97-1_all.deb ...
Unpacking libhtml-template-perl (2.97-1) ...
Selecting previously unselected package mysql-client.
Preparing to unpack .../7-mysql-client_5.7.24-0ubuntu0.18.04.1_all.deb ...
Unpacking mysql-client (5.7.24-0ubuntu0.18.04.1) ...
Selecting previously unselected package mysql-server.
Preparing to unpack .../8-mysql-server_5.7.24-0ubuntu0.18.04.1_all.deb ...
Unpacking mysql-server (5.7.24-0ubuntu0.18.04.1) ...
Setting up libevent-core-2.1-6:amd64 (2.1.8-stable-4build1) ...
Setting up libhtml-template-perl (2.97-1) ...
Processing triggers for ureadahead (0.100.0-20) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Setting up libaio1:amd64 (0.3.110-5) ...
Processing triggers for systemd (237-3ubuntu10.9) ...
Processing triggers for man-db (2.8.3-2) ...
Setting up mysql-client-core-5.7 (5.7.24-0ubuntu0.18.04.1) ...
Setting up mysql-server-core-5.7 (5.7.24-0ubuntu0.18.04.1) ...
Setting up mysql-client-5.7 (5.7.24-0ubuntu0.18.04.1) ...
Setting up mysql-client (5.7.24-0ubuntu0.18.04.1) ...
Setting up mysql-server-5.7 (5.7.24-0ubuntu0.18.04.1) ...
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Renaming removed key_buffer and myisam-recover options (if present)
Created symlink /etc/systemd/system/multi-user.target.wants/mysql.service → /lib/systemd/system/mysql.service.
Setting up mysql-server (5.7.24-0ubuntu0.18.04.1) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Processing triggers for systemd (237-3ubuntu10.9) ...
Processing triggers for ureadahead (0.100.0-20) ...
USERNAME@USERNAME-VirtualBox:~$ mysql -uroot -p
Enter password:
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
USERNAME@USERNAME-VirtualBox:~$ mysql -uroot -p
Enter password:
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
Ubuntu上 MySQL安装后,无法访问服务器,
USERNAME@USERNAME-VirtualBox:~$ whereis mysql
mysql: /usr/bin/mysql /usr/lib/mysql /etc/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz
参考:
ubuntu18.04 安装mysql不出现设置 root 帐户的密码问题
https://blog.csdn.net/NeptuneClouds/article/details/80995759
update mysql.user set authentication_string=password('password') where user='root'and Host = 'localhost';
更改root账号密码:
mysql> select host,user from mysql.user;
+-----------+------------------+
| host | user |
+-----------+------------------+
| localhost | debian-sys-maint |
| localhost | mysql.session |
| localhost | mysql.sys |
| localhost | root |
+-----------+------------------+
4 rows in set (0.00 sec)
mysql>
mysql> update mysql.user set authentication_string=password("") where user = 'root' and host = 'localhost';
Query OK, 0 rows affected (0.00 sec)
Rows matched: 1 Changed: 0 Warnings: 0
mysql> update mysql.user set authentication_string=password("111111") where user = 'root' and host = 'localhost';
Query OK, 1 row affected, 1 warning (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 1
更改root账号的plugin:为什么?更改后可以不需要添加sudo即可使用mysql登录,
mysql> select user,host,authentication_string,plugin from user where user = 'root';
+------+-----------+-------------------------------------------+-------------+
| user | host | authentication_string | plugin |
+------+-----------+-------------------------------------------+-------------+
| root | localhost | *FD571203974BA9AFE270FE62151AE967ECA5E0AA | auth_socket |
+------+-----------+-------------------------------------------+-------------+
1 row in set (0.00 sec)
mysql> update user set plugin='mysql_native_password' where user = 'root';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
Ubungu 18.04安装MySQL 5.7.24的更多相关文章
- Ubuntu 18.04 安装MySQL
最近在写东西的时候,需要用到MySQL,在网上查了一下,都说Ubuntu18.04不能安装MySQL5.7.22, 总觉的不可能,所以自己就研究了一下,然后分享给大家 工具/原料 VMware W ...
- 在Ubuntu 18.04 安装 MySQL 8.0
在Ubuntu 18.04 安装 MySQL 8.0 ① 登入 mysql 官网,在官网中下载 deb 包,点击该链接,即可下载. https://dev.mysql.com/downloads/re ...
- Ubuntu 18.04安装MySQL指南
前言 Ubuntu18.04想要安装MySQL,只能安装MySQL8.0版本.如果你直接 apt-get install mysql-server 安装,那么恭喜踩坑! 先给出彻底删除mysql5.x ...
- ubuntu 18.04 安装mysql 8.0
1.下载配置(不然直接装的是mysql5.7): wget https://repo.mysql.com//mysql-apt-config_0.8.10-1_all.deb 2.更新配置: sudo ...
- Ubuntu 18.04安装MySQL
安装 MySQL 服务端 sudo apt-get install mysql-server 等待安装完成. 检查 mysql 服务状态 servive mysql status 登录 mysql 客 ...
- ubuntu 18.04 安装mysql 遇到语言格式不兼容性问题解决
安装mysql的时候,遇到了这样一个错误:perl: warning: Setting locale failed. perl: warning: Please check that your loc ...
- 关于乌班图18.04安装mysql不提示设置密码解决方案
1.下载安装mysql sudo apt-get update sudo apt-get install -y mysql-server mysql-client //下载mysql 运行mysql时 ...
- ubuntu 18.04安装mysql 8
wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.10-1_all.deb sudo dpkg -i mysql-apt-config_0. ...
- Ubuntu 18.04 安装配置 MySQL 5.7
Ubuntu 18.04 安装 mysql 的过程中,竟然没有让你输入秘密?!(之前在 Ubuntu 14.04 下,安装过程中会询问密码),这导致安装完 mysql 初始秘密不知道的问题. $ su ...
随机推荐
- redux与react-redux
Redux是一个数据状态管理插件,论是移动端还是 pc 端,当你使用 React 或者 vue 开发组件化的 SPA 程序时, 组件之间共享信息是一个非常大的问题.在react开发中,使用 React ...
- idea 注释中的错误不再提示
- (stack)Train Problem I hdu1022
Train Problem I Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) ...
- 搞定 Kubernetes 基于flannel 的集群网络
.Docker网络模式 在讨论Kubernetes网络之前,让我们先来看一下Docker网络.Docker采用插件化的网络模式,默认提供bridge.host.none.overlay.maclan和 ...
- CodeForces - 893D 贪心
http://codeforces.com/problemset/problem/893/D 题意 Recenlty Luba有一张信用卡可用,一开始金额为0,每天早上可以去充任意数量的钱.到了晚上, ...
- Python基础【day03】:字典(一)
本节内容 简述 语法 字典的使用 字典内置方法 一.简述 字典是Python中的又一种数据结构,它是通过key-value的数据类型,跟我们小时候用的新华字典差不多,通过key去访问value 二.语 ...
- 设计模式---组件协作模式之策略模式(Strategy)
一:概念 Strategy模式,对一系列的算法加以封装,为所有算法定义一个抽象的算法接口,并通过继承该抽象算法接口对所有的算法加以封装和实现,具体的算法选择交由客户端决定(策略). Strategy模 ...
- CM记录-Hadoop 分布式文件系统HDFS(登录、配置、监控)
1.登录(浏览器输入ip地址:7180,登录用户名和登录密码即可) 2.CM主界面(各个组件,监控图表,绿色代表运行正常.黄色代表运行不良,需要关注根据实际情况调整,红色代表故障,需要排查问题) 3. ...
- bzoj千题计划299:bzoj1856: [Scoi2010]字符串
http://www.lydsy.com/JudgeOnline/problem.php?id=1856 卡特兰数 从(1,1)走到(n,m),不能走y=x 上方的点,求方案数 从(1,1)走到(n, ...
- python 小程序,替换文件中的字符串
[root@PythonPC ~]# cat passwd root:x:::root:/root:/bin/bash bin:x:::bin:/bin:/sbin/nologin daemon:x: ...