树莓派3b+安装ubuntu server,安装mysql

2023-05-16

1、[下载镜像]
http://cdimage.ubuntu.com/ubuntu/releases/18.04.5/release/ubuntu-18.04.5-preinstalled-server-arm64+raspi3.img.xz
2、解压
3、把镜像写入tf卡,插入树莓派
4、登录,初始账户及密码
用户名:ubuntu
密码:ubuntu
初次登陆修改密码
Ubuntu server安装成功
5、添加root用户
输入命令sudo passwd 给root用户设置密码
输入su命令,切换至root用户
6、root用户不允许远程登陆,修改一下令root 允许ssh远程登录

sudo vim /etc/ssh/sshd_config

找到PermitRootLogin without-password 修改为PermitRootLogin yes 或者直接添加PermitRootLogin yes
7、service ssh restart 重启ssh,用ssh工具登录
8、修改默认源

先备份/etc/apt/sources.list,

cd /etc/apt/
cp sources.list sources.list.d
vi /etc/apt/sources.list 

然后把sources.list里面的内容替换为:

## Note, this file is written by cloud-init on first boot of an instance
## modifications made here will not survive a re-bundle.
## if you wish to make changes you can:
## a.) add 'apt_preserve_sources_list: true' to /etc/cloud/cloud.cfg
##     or do the same in user-data
## b.) add sources in /etc/apt/sources.list.d
## c.) make changes to template file /etc/cloud/templates/sources.list.tmpl
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic main restricted
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic-updates main restricted
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic universe
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic universe
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic-updates universe
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic-updates multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic-backports main restricted universe multiverse
 
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic-security main restricted
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic-security main restricted
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic-security universe
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic-security universe
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic-security multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic-security multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu bionic partner
# deb-src http://archive.canonical.com/ubuntu bionic partner
 

更新

sudo apt-get update
sudo apt-get upgrate

9、安装mysql

sudo apt install mysql-server

10、配置mysql

mysql_secure_installation
root@ubuntu-virtual-machine:~# mysql_secure_installation

Securing the MySQL server deployment.

Connecting to MySQL using a blank password.

VALIDATE PASSWORD PLUGIN can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD plugin?    # 要安装验证密码插件吗?

Press y|Y for Yes, any other key for No: N    # 这里我选择N
Please set the password for root here.

New password:   # 输入要为root管理员设置的数据库密码

Re-enter new password:   # 再次输入密码


By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.

Remove anonymous users? (Press y|Y for Yes, any other key for No) : y     # 删除匿名账户
Success.


Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : N    # 禁止root管理员从远程登录,这里我没有禁止

... skipping.
By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.


Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y   # 删除test数据库并取消对它的访问权限
- Dropping test database...
Success.

- Removing privileges on test database...
Success.

Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.

Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y   # 刷新授权表,让初始化后的设定立即生效
Success.

All done!

用mysql -u root -p命令,Enter password:处输入刚设置的密码,回车,就能够进入mysql数据库。

使用 use mysql; 命令打开mysql命名的数据库,显示当前数据库的表:show tables; 查询user表里的数据:select * from user;(user表里是mysql数据库的所有账户信息)
11、配置mysql允许远程访问
编辑 /etc/mysql/mysql.conf.d/mysqld.cnf 配置文件:

vim /etc/mysql/mysql.conf.d/mysqld.cnf

用# 注释掉bind-address = 127.0.0.1
在这里插入图片描述
保存,进入mysql授权

mysql -u root -p
mysql> grant all on *.* to root@'%' identified by '你的密码' with grant option;

mysql> flush privileges;    # 刷新权限

mysql> exit

重启mysql服务

systemctl restart mysql
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

树莓派3b+安装ubuntu server,安装mysql 的相关文章

  • PHP 选择后立即删除

    我有一个 PHP 服务器脚本 它从 MySQL 数据库中选择一些数据 一旦我将 mysql query 和 mysql fetch assoc 的结果存储在我自己的局部变量中 我就想删除我刚刚选择的行 这种方法的问题在于 PHP 似乎对我的
  • 在 MacOSX10.6 上运行 python 服务器时 MySQLdb 错误

    运行我的服务器 python manage py runserver 产生以下错误 django core exceptions ImproperlyConfigured 加载 MySQLdb 模块时出错 没有名为 MySQLdb 的模块
  • ActiveRecord3死锁重试

    Rails 3 或 ActiveRecord 3 是否有任何插件可以复制旧版本死锁重试 http agilewebdevelopment com plugins deadlock retry插入 或者 该插件仍然适用于 Rails 3 吗
  • 对于数据库来说,选择正确的数据类型会影响性能吗?

    如果是这样 为什么 我的意思是 tinyint 的搜索速度比 int 快吗 如果是这样 性能上的实际差异是什么 是的 根据数据类型 它确实有所不同 int vs tinyint不会在速度上产生明显的差异 但会在数据大小上产生差异 假设tin
  • Python:如何使用生成器来避免 sql 内存问题

    我有以下方法来访问 mysql 数据库 并且查询在服务器中执行 我无权更改有关增加内存的任何内容 我对生成器很陌生 并开始阅读更多有关它的内容 并认为我可以将其转换为使用生成器 def getUNames self globalUserQu
  • gitlab 上的权限被拒绝(公钥)

    我的问题是我无法从 GitLab 推送或获取 不过 我可以克隆 通过 HTTP 或通过 SSH 当我尝试推送时出现此错误 权限被拒绝 公钥 致命 无法从远程存储库读取 从我看过的所有线程中 这是我所做的 在我的计算机上设置 SSH 密钥并将
  • 当sql连接中存在两个同名列时,如何从一个表列中获取值

    当我连接两个具有相同名称列的表时 我目前面临着尝试获取值的问题 例如 table1 date和table2 date 每个表中的日期不同 我将如何获取 日期 本例中的表1 我目前正在跑步 while row mysqliquery gt f
  • MYSQL 区分大小写的 utf8 搜索(使用 hibernate)

    我的登录表具有 utf8 字符集和 utf8 排序规则 当我想要检查用户名并检索该特定用户名的其他信息时 hql 查询会为我提供小写和大写相同的结果 我应该如何处理适用于案例的 HQL 查询 我使用 Mysql 5 和 java hiber
  • 如何正确转义mysql?

    我刚刚发现如果我写 select from tbl where name like foo 然后添加 foo 作为参数及其值 a 用户数据 它不会正确转义 我勒个去 它想要 a 即使我使用参数 我还是忍不住觉得我对 sql 注入持开放态度
  • 无法通过套接字“/var/lib/mysql/mysql.sock”连接到本地 MySQL 服务器 (2)

    当我尝试连接 mysql 时出现以下错误 Can t connect to local MySQL server through socket var lib mysql mysql sock 2 这个错误有解决办法吗 其背后的原因可能是什
  • MySQL 按重复项从上到下排序

    我有一个lammer问题 因为我不是mysql专业人士 我有类似的字段 id color 1 red 2 green 3 yellow 4 green 5 green 6 red 我想按重复项进行分组 最常见的重复项先进行分组 所以应该这样
  • MySQL Connector C/C API - 使用特殊字符进行查询

    我是一个 C 程序 我有一个接受域名参数的函数 void db domains query char name 使用 mysql query 我测试数据库中是否存在域名 如果不是这种情况 我插入新域名 char query 400 spri
  • 将第三个表链接到多对多关联中的桥接表

    设计这个数据库的正确方法是什么 这是我设置表格的方式 我在名为 教师 的表和名为 仪器 的表之间存在多对多关系 然后我有一个连接两者的桥接表 我想将另一个表与 BRIDGE 表关联起来 意思是乐器 老师的组合 该表有 3 行 指定老师可以教
  • 如何使用 vitess 仅对特定表进行分片

    我创建了一个包含三个表的未分片键空间 现在我想对前两个表的键空间进行分片 但不想对第三个表进行分片 如何才能做到这一点 Vitess 文档不包含任何与此相关的信息或示例 请帮忙 Thanks vitess 中的垂直分片与水平分片类似 您应该
  • gem install mysql:无法构建 gem 本机扩展 (Mac Lion)

    我为 Mac OS X Lion 安装了 MySQL 5 5 27 来自 dmg 现在我尝试安装 mysql gem gem install mysql Building native extensions This could take
  • Mysql 将 int 转换为 MAC

    我有一些数据可以转换 其中有 2 列 其中一列有 IP 它包含整数值 我在 mysql 查询中使用了以下函数 是否有一个函数可以用来转换我的 mac 列 其中包含整数和数据类型是bigint to MAC地址 SELECT INET NTO
  • 如何将ElasticSearch与MySQL集成?

    在我的一个项目中 我计划将 ElasticSearch 与 MySQL 结合使用 我已经成功安装ElasticSearch 我可以单独管理ES中的索引 但我不知道如何用 MySQL 实现同样的功能 我读过一些文件 但我有点困惑 没有明确的想
  • Java JDBC:更改表

    我希望对此表进行以下修改 添加 状态列 varchar 20 日期列 时间戳 我不确定该怎么做 String createTable Create table aircraft aircraftNumber int airLineCompa
  • 同一配置文件上的两个不同提供程序

    我在用着实体框架 6 1 0 I have 2 家提供者 MysqlClient 和 SQLServerCE 我需要创建2个不同的DBContext 这迫使我创造2个配置类因为mysql有一些不同的东西 但是当我初始化应用程序时 Datab
  • Apache 2 中的“捕获 SIGWINCH”错误是什么?

    我的服务器 ubuntu 8 04 LAMP运行drupal 6 当流量较高时 它会停止提供页面 重新启动apache2将不起作用 所以我必须重新启动该服务 我在 apache2 error log 中找到了这条消息 通知 捕获SIGWIN

随机推荐

  • HDFS读流程

    文章目录 HDFS读流程读流程的概述读流程大体步骤对逻辑图的解释读流程代码 剖析OPEN方法客户端类关系图NameNode数据存储逻辑图 服务端方法关系图 对Block列表进行排序 剖析READ方法数据传输格式客户端方法关系图服务端方法关系
  • 应用层log函数的写法

    int my log const char format va list args FILE fp fp 61 fopen 34 tmp my log 34 34 a 43 34 if fp fprintf stderr 34 fp is
  • 工程计算流体力学软件FloEFD

    推荐一款工程计算流体力学软件FloEFD 此前一直使用ICEM 43 FLUENT软件 xff0c 后来由于工作原因 xff0c 使用的机会逐渐变少了 对不少人而言 xff0c CFD通常作为一种工程的辅助工具 xff0c 不想花太多精力
  • #统计整数个数(指针)

    以下面这题为例 xff1a 题目内容 xff1a 输入一个字符串 xff0c 其包括数字和非数字字符 xff0c 如 xff1a a123x456 17935 098tab xff0c 将其中连续的数字作为一个整数 xff0c 依次存放到数
  • 富斯i6B接收机与pixhawk连接

    pix接收PPM编码信号 xff0c 传统PWM接收器不能直接接收 xff08 例如FS ia6 xff09 xff0c 通常需要PWM转PPM转接板 xff0c 或者直接采用PPM输出的接收器 xff08 例如FS ia6B xff09
  • mission planner飞行模式设置

    我采用的富斯i6遥控器 xff0c 可以设置三种飞行模式 飞行模式中有六种模式 xff0c 在哪三个通道设置会与遥控器对应呢 xff1f 首先在 遥控器校准 选 项观察切换遥控器 模式时 输出的pwm值 xff1a 三个值分别为1000 1
  • ArduPilot Tutorial(PDF版)及ArduPilot飞行模式介绍

    ArduPilot官方Tutorial PDF 2017 2 http download csdn net download xiaoshuai537 10262086 ArduPilot中有14种常用的模式 xff1a 依赖GPS的模式有
  • PX4飞行模式-多旋翼

    手动模式 xff08 1 xff09 ARCO xff1a 特技模式 遥控器输入被转换为横滚 俯仰和偏航速度 xff0c 当摇杆回中时飞行器不会保持平衡 xff0c 可以用于翻滚等特技飞行 xff08 2 xff09 RATTITUDE x
  • 《PID控制算法的C语言实现》学习笔记

    1 PID算法原理 如果偏差为0 xff0c 则比例环节不起作用 xff1b 积分环节主要是用来消除静差 xff0c 即系统稳定后输出值和设定值之间的差值 xff1b 微分环节则反映了偏差信号的变化规律 xff0c 根据偏差信号的变化趋势来
  • 跟我一起写Makefile(整理版)

    跟我一起写Makefile 陈皓 xff08 博客地址 xff1a http blog csdn net haoel article details 2886 xff09 整理的PDF文件 xff1a http download csdn
  • PX4 Makefile分析解读

    参考文章 xff1a PX4源码的Makefile详细理解 http blog csdn net linkcian article details 79152724 感谢原文作者 主要分析 make px4fmu v2 default编译流
  • CREO工程图学习笔记

    CREO工程图技术手册 学习笔记 1 小功能 不同窗口切换操作 xff1a 视图 激活 材料设置 xff1a 文件 准备 模型属性 2 视图创建 插入视图 xff1a 图纸上长按右键 插入普通视图插入投影视图 xff1a 选择母视图 xff
  • 操作系统清华向勇陈渝版笔记(七) 进程与线程 PCB TCB 进程挂起 用户线程 内核线程 轻量级进程 僵尸队列

    7 1 进程定义 OS系统从只能跑一个程序到能跑多个 进程可以描述程序的执行过程 进程 xff1a 一个具有一定独立功能的程序在一个数据集合上的一次动态执行过程 只有当一个程序被OS加载到内存中 xff0c cpu对其执行时 xff0c 这
  • 基于stm32F103HAL库+cubemx+freertos无感无刷电机BLDC控制程序开发

    基于stm32F103HAL库 43 cubemx 43 freertos无感无刷电机BLDC控制程序开发 最近在做一个舵机控制项目 xff0c 控制对象为大功率无感无刷电机 xff0c 网上搜遍了资源 xff0c 貌似这方面的资源真得十分
  • C++思路

    1 统计英文单词 在进行文章重复度检查时 xff0c 经常需要统计一段英文中的单词数量 xff0c 并找出长度最长的单词 设有如下定义 xff1a char str 500 编写程序 xff0c 通过利用cin getline str 50
  • 基于OpenCV构建停车场车位识别项目

    OpenCV是一个基于 xff08 开源 xff09 发行的跨平台计算机视觉库 xff0c 能实现图像处理和计算机视觉方面的很多通用算法 车位识别的图像处理过程如图所示 在python中设置完所有内容后 xff0c 最重要的依赖关系将是Op
  • 学生成绩管理系统-python

    乱写的成绩管理系统 派森 span class token comment 定义学生类型 姓名 学号 科目 span span class token keyword class span span class token class na
  • 11_3、Java集合之迭代器Iterator接口

    一 引入 Iterator对象称为迭代器 设计模式的一种 xff0c 主要用于遍历 Collection 集合中的元素 GOF给迭代器模式的定义为 xff1a 提供一种方法访问一个容器 container 对象中各个元 素 xff0c 而又
  • 进程切换和进程调度的区别

    进程切换和进程调度的区别 调度是决定将系统资源分配给哪个进程 xff0c 进程切换是实际分配系统资源 另外需要注意进程切换一定会产生中断 xff0c 进行处理器模式切换 xff0c 即从用户态进入内核态 xff0c 之后又回到用户态 xff
  • 树莓派3b+安装ubuntu server,安装mysql

    1 下载镜像 http cdimage ubuntu com ubuntu releases 18 04 5 release ubuntu 18 04 5 preinstalled server arm64 43 raspi3 img xz