考虑到很多孩子不会Linux或Mysql,所以我这里提示一下,

这篇教程里 "有多行代码" 的是给你展示结果的,不用你敲

只有一行的才是要你自己敲进去的.

 

1.首先更新一下仓库

sudo apt-get update
2.安装mysql sudo apt-get install -y mysql-server mysql-client
3.检查mysql是否已运行 sudo netstat -tap | grep mysql
有显示就是已运行 4.查询默认的用户名和密码 (提示:sudo命令会让你输入你的用户密码,就是你的开机密码,并且你输入的时候看不到自己输入的内容,不要以为电脑卡住了,输完回车就行) sudo cat /etc/mysql/debian.cnf
显示出来的内容格式如下(我的密码,跟你不一样) baiguo@baiguo-PC:~$ sudo cat /etc/mysql/debian.cnf
# Automatically generated for Debian scripts. DO NOT TOUCH!
[client]
host = localhost
user = debian-sys-maint
password = F64nKZ233QkzL8v9
socket = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host = localhost
user = debian-sys-maint
password = F64nKZ233QkzL8v9
socket = /var/run/mysqld/mysqld.sock
其中user代表的用户名,password代表的默认生成的密码 5.利用默认账号密码登录(-p后面是我的密码,你们要把自己的密码放在那里,并且-p跟密码之间无空格) mysql -u debian-sys-maint -pF64nKZ233QkzL8v9
成功进入mysql,有如下显示: baiguo@baiguo-PC:~$ mysql -u debian-sys-maint -pF64nKZ233QkzL8v9
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.21-1 (Debian) Copyright (c) 2000, 2018, 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>
6.现在更改密码的设置.(原封不动复制过去,漏一个字你就完了),这是最重要的部分,很多教程都没有这个,所以才不管用
update mysql.user set plugin="mysql_native_password" where user="root";
成功后结果如下: mysql> update mysql.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>
7.设置root的密码 update mysql.user set authentication_string=password('这里是你的密码') where user='root'and Host = 'localhost';
密码自己设置 8.退出数据库 exit
9.重新启动数据库 sudo service mysql restart
10.用自己设置好的密码登录 mysql -u root -p
输入密码,成功登录,如下. baiguo@baiguo-PC:~$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.21-1 (Debian) Copyright (c) 2000, 2018, 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> nice!
---------------------

linux 部署之路 修行不够全靠悟的更多相关文章

  1. linux部署django项目流程(全)

    1.python3和python2共存配置 流程在下面网址中 https://www.cnblogs.com/vinic-xxm/p/11358894.html 2.安装依赖包 yum install ...

  2. Linux 部署ASP.NET SQLite 应用 的坎坷之旅 附demo及源码

    Linux 部署ASP.NET SQLite 应用 的坎坷之旅.文章底部 附示例代码. 有一台闲置的Linux VPS,尝试着部署一下.NET 程序,结果就踏上了坑之路,不过最后算是完美解决问题,遂记 ...

  3. .NET持续集成与自动化部署之路第一篇——半天搭建你的Jenkins持续集成与自动化部署系统

    .NET持续集成与自动化部署之路第一篇(半天搭建你的Jenkins持续集成与自动化部署系统) 前言     相信每一位程序员都经历过深夜加班上线的痛苦!而作为一个加班上线如家常便饭的码农,更是深感其痛 ...

  4. Linux系统之路——如何在服务器用U盘安装CentOS7.2(二)

    Linux系统之路——如何在服务器用U盘安装CentOS7.2(一) 说明: 截止目前CentOS 7.x最新版本为CentOS 7.2.1511,下面介绍CentOS 7.2.1511的具体安装配置 ...

  5. Linux下搭建tomcat集群全记录

    (转) Linux下搭建tomcat集群全记录 2011-10-12 10:23 6133人阅读 评论(1) 收藏 举报 tomcatlinuxapacheinterceptorsession集群 1 ...

  6. Linux随笔-鸟哥Linux基础篇学习总结(全)

    Linux随笔-鸟哥Linux基础篇学习总结(全) 修改Linux系统语系:LANG-en_US,如果我们想让系统默认的语系变成英文的话我们可以修改系统配置文件:/etc/sysconfig/i18n ...

  7. Linux学习之路-Linux-at及cron命令【7】---20171215

    Linux学习之路-Linux-at及cron命令[7]---20171215 DannyExia000人评论986人阅读2017-12-24 17:28:03   ntpdate 命令 [root@ ...

  8. Linux上天之路系列目录

    Linux上天之路系列目录 Linux上天之路(一)之Linux前世今生 Linux上天之路(二)之Linux安装 Linux上天之路(三)之Linux系统目录 Linux上天之路(四)之Linux界 ...

  9. linux常用命令与实例小全

    转至:https://www.cnblogs.com/xieguohui/p/8296864.html  linux常用命令与实例小全 阅读目录(Content) 引言 一.安装和登录 (一)    ...

随机推荐

  1. P4238 【模板】多项式求逆 ntt

    题意:求多项式的逆 题解:多项式最高次项叫度deg,假设我们对于多项式\(A(x)*B(x)\equiv 1\),已知A,求B 假设度为n-1,\(A(x)*B(x)\equiv 1(mod x^{\ ...

  2. 把xml转成javabean的工具类

    import java.io.IOException; import java.io.StringReader; import java.io.StringWriter; import javax.x ...

  3. CRM 价格批导

    日了,好多代码....COPY别人的,懒得改了 *----------------------------------------------------------------------* *** ...

  4. MRBS开源会议室预订系统安装

    MRBS系统官方网址  https://mrbs.sourceforge.io/ 最近在找一份开源的会议室预订系统,找了很多种,ASP,PHP的,测试发现MRBS无疑是最好的.开源社区对其介绍如下:M ...

  5. 前端页面兼容ie8解决方法

    一.通用兼容文件的引用: 1.HTML5标签兼容方案:html5shiv.js GitHub地址:https://github.com/aFarkas/html5shiv/ IE8不支持HTML5的新 ...

  6. git设置远程同步分支

    git push --set-upstream origin yourBranchName

  7. 一、I/O操作(流的概念)

    一.流(Stream) 所谓流(Stream),就是一系列的数据. 当不同的介质之间有数据交互的时候,java就会使用流来实现. 数据源可以使文件,还可以是数据库,网络,甚至是其他的程序 不如读取文件 ...

  8. eclipse初学者的使用

    eclipse的使用 字体设置:      设置环境字符: 设置背景颜色 寻找窗口: java JDK的配置: 配置自动提示: 适合初学者适应环境开发.

  9. 如何解决Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 8000401a. 问题

    在系统中需要把数据导出到excel并且压缩,然后报了这个问题: 我在网站上找到了方法: 地址:https://social.msdn.microsoft.com/Forums/vstudio/en-U ...

  10. 这样好用的ReactiveCocoa,根本停不下来

    作者:空之境界(博客) 前戏我个人非常推崇ReactiveCocoa,它就像中国的太极,太极生两仪,两仪生四象,四象生八卦,八卦生万物.ReactiveCocoa是一个高度抽象的编程框架,它真的很抽象 ...