九阴白骨爪(2)Ubuntu20.04下MySQL/Anaconda/Django的安装与配置

  • 1.用apt install mysql-server安装MySQL
  • 2.修改MySQL的root密码
  • 3.创建后端架构需要的数据库用户名及密码/授权
  • 4.创建新的系统用户
  • 5.Anaconda的安装和配置

1.用apt install mysql-server安装MySQL

大约过不了多久,系统提示安装好了,去/etc/mysql里面看看,的确是安装好了。

root@jae71e:~# cd /etc/mysql
root@jae71e:/etc/mysql# ls
conf.d  debian.cnf  debian-start  my.cnf  my.cnf.fallback  mysql.cnf  mysql.conf.d

然后就是

2.修改MySQL的root密码

这部分我以前写过,这次直接抄过来
password后的xxxxxxxx就是用户debian-sys-maint的登陆密码

root@jae71e:/etc/mysql# cat debian.cnf
# Automatically generated for Debian scripts. DO NOT TOUCH!
[client]
host     = localhost
user     = debian-sys-maint
password = xxxxxxxx
socket   = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host     = localhost
user     = debian-sys-maint
password = xxxxxxxx
socket   = /var/run/mysqld/mysqld.sockroot@jae71e:/etc/mysql# mysql -udebian-sys-maint -pxxxxxxxx
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 8
Server version: 8.0.26-0ubuntu0.20.04.2 (Ubuntu)Copyright (c) 2000, 2021, Oracle and/or its affiliates.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>

然后授权远程登录+改密码

mysql> use mysql
mysql> update user set host='%' where user='root';#不用远程登陆就不用%
mysql> flush privileges;
mysql> alter user root@'%' identified by '123456' password expire never;
mysql> alter user 'root'@'%' identified with mysql_native_password by '123456';
mysql> flush privileges;

现在exit出来看看是否成功:

mysql> exit
Bye
root@jae71e:/etc/mysql# mysql -uroot -p123456
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 12
Server version: 8.0.26-0ubuntu0.20.04.2 (Ubuntu)Copyright (c) 2000, 2021, Oracle and/or its affiliates.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> 

现在看到,修改成功了

3.创建后端架构需要的数据库用户名及密码/授权

mysql> create database django;
Query OK, 1 row affected (1.19 sec)mysql> create user django@'localhost' identified by 'django';
Query OK, 0 rows affected (0.12 sec)mysql> grant all privileges on django.* to django@'localhost';
Query OK, 0 rows affected (0.02 sec)mysql> flush privileges;

由于我不需要远程登陆数据库,所以主机都改成了localhost。最后就成了这样:

mysql> select user,host from user;
+------------------+-----------+
| user             | host      |
+------------------+-----------+
| debian-sys-maint | localhost |
| django           | localhost |
| mysql.infoschema | localhost |
| mysql.session    | localhost |
| mysql.sys        | localhost |
| root             | localhost |
+------------------+-----------+
6 rows in set (0.00 sec)

4.创建新的系统用户

root@jae71e:~# adduser eric
Adding user `eric' ...
Adding new group `eric' (1000) ...
Adding new user `eric' (1000) with group `eric' ...
Creating home directory `/home/eric' ...
Copying files from `/etc/skel' ...
New password:
Retype new password:
passwd: password updated successfully
Changing the user information for eric
Enter the new value, or press ENTER for the defaultFull Name []: Room Number []: Work Phone []: Home Phone []: Other []:
Is the information correct? [Y/n] y
root@jae71e:~# cd /home
root@jae71e:/home# ls
eric

记得以前还要为新增用户做远程登陆的配置,不知这次为什么直接就登上去了。

5.Anaconda的安装和配置

百度搜索清华Anaconda,搜索结果第一条就是清华的Anaconda镜像帮助。可以从上面下载Anaconda的安装包。
我本地硬盘里有现成的,用Filezilla传上去(就是把文件拖到右面远程站点就ok)。因为我用的这个云主机只有1M的带宽,所以上传下载都奇慢无比,570.9M的东西上传了一个多小时。

eric@jae71e:~/source$ bash Anaconda3-2021.05-Linux-x86_64.sh

安装完成后重新登陆,发现conda启动了。

(base) eric@jae71e:~$

现在修改pip源为清华源

(base) eric@jae71e:~$ pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
Writing to /home/eric/.config/pip/pip.conf

Anaconda国内源也改成清华的

(base) eric@jae71e:~$ conda config --set show_channel_urls yes

执行完这句在刷新Filezilla,发现**.condarc这个文件有了,在Filezilla里右键点击,选查看/编辑**。

把下面清华Anaconda 镜像使用帮助的内容替换调原文件的内容,

channels:- defaults
show_channel_urls: true
default_channels:- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloudmsys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloudbioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloudmenpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloudpytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloudsimpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud

保存退出。

现在创建虚拟环境,激活创建的虚拟环境,安装Django,pymysql等需要用的python包。

(base) eric@jae71e:~$ conda create -n chsdrgs python=3.8
(base) eric@jae71e:~$ conda activate chsdrgs
(chsdrgs) eric@jae71e:~$ pip install django
(chsdrgs) eric@jae71e:~$ pip install pymysql

九阴白骨爪(2)Ubuntu20.04下配置环境(MySQL/Anaconda/Django)相关推荐

  1. Ubuntu20.04下配置深度学习环境

    文章目录 一.安装Anaconda 1.安装Anaconda 2.区分ubuntu系统中自带的python与Anaconda中带的python 3.创建一个深度学习环境 二.安装cuda与cudnn ...

  2. Ubuntu20.04下配置Anaconda3+NVIDIA 驱动+Cuda11.1+Cudnn8.0.5

    安装Ubuntu20.04 1.首先,拿出一个U盘,将官网下载的 Ubuntu20.04 刷进去制作成启动盘. 这里制作启动盘的软件我使用的是xxxx 2.分区设置(自定义四个分区) 因为我把 Ubu ...

  3. 深度学习Ubuntu20.04+CUDA+Pytorch环境配置+无显示器远程控制(1)

    一.各个软件版本检查 首先在INVIDIA官网上查看CUDA与Ubuntu系统的对应支持关系:然后检查pytorch和CUDA版本的支持关系,确保三者都是互相兼容的.如果懒得查,一般安装两年前版本的U ...

  4. 【学习mysql】ubuntu20.04下彻底删除mysql8.0

    ubuntu20.04下安装mysql8.0配置出错次数到吐血,却熟练了删除mysql的基本操作.记录一下 1.保证mysql进程停止 sudo service mysql stop 2.查看mysq ...

  5. Linux Ubuntu20.04安装及环境配置细节分享

    目录 1.Ubuntu和VMware虚拟机官方下载 2.在英文环境下配置中文拼音输入法 3.火狐浏览器看不了视频问题 4.配置代码编辑环境 5.隐藏桌面垃圾桶图标 6.关于网络问题个人的一些建议 因为 ...

  6. Java基础:Ubuntu20.04下JDK1.8安装+配置

    Java基础:Ubuntu20.04 下JDK1.8安装+配置 Step_1: 下载JDK Oracle官网下载地址 点击上方链接,页面顶部是当前最新发布版本的JDK,一定要下拉到页面中下位置,下方提 ...

  7. Ubuntu20.04安装配置tensorflow2深度学习环境

    Ubuntu20.04安装配置tensorflow2深度学习环境 之前在windows下配置了tensorflow2的环境,坑有不少.最近配了台台式机,2070显卡,安装一下Ubuntu20.04系统 ...

  8. ubuntu20.04下CLion2020.1.3安装配置ROS过程说明

    ** ubuntu20.04下CLion2020.1.3安装配置ROS过程说明 ** 一 下载安装激活CLion 按照网上给的教程就可以 二 配置ROS 1.配置CLion的启动方式 在主目录打开隐藏 ...

  9. DELF: DEep Local Features在Ubuntu20.04下安装配置

    提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档 DELF: DEep Local Features在Ubuntu20.04下安装配置 一.安装Ubuntu20.04后配置深度学习环境 ...

最新文章

  1. k8S中的MySQL如何扩容_Kubernetes的etcd多节点扩容实战技巧
  2. DL框架之TensorFlow:深度学习框架TensorFlow Core(低级别TensorFlow API)的简介、安装、使用方法之详细攻略
  3. Buuctf(pwn)ciscn_2019_n_8
  4. 词汇挖掘与实体识别(未完)
  5. 解决int和Integer不能互转
  6. 网站的php主题怎么删掉,简介如何去除WordPress主题版权保护的方法 | 垃圾站
  7. 屏保延迟启用密码保护
  8. 总结:Homography和图像拼接
  9. 程序员面试金典--疯狂刷
  10. vue纯前端下载excel表格
  11. SQLSERVER2012备份日志报错:”读取失败: 23(数据错误(循环冗余检查)。)”
  12. Windows Core Audio APIs(一)介绍
  13. python读取xlsx文件找不到_在python中打开并读取excel .xlsx文件
  14. 自学python网站-杭州python自学网站
  15. python生成中文词云图
  16. 印象笔记 linux 命令行,在Linux的命令行下使用Evernote的教程
  17. WDK与DDK的区别
  18. Qt开发的开源项目DBA技术介绍
  19. 很多事情都由计算机或机器人来完成英语,八年级下册英语作文6篇
  20. 戴尔业务伸向IT服务:佩罗收购毕博背后

热门文章

  1. 【美盘趋势】3.30黄金晚盘能否拉升向上?原油走势及操作策略
  2. what is BI and OLAP?
  3. Spark问题:System memory 259522560 must be at least 4.718592E8. Please use a larger heap size.
  4. 关于仓储规划的内容,太全了!忍不住收藏(干货)
  5. windows的磁盘操作之九——区分本地磁盘与移动硬盘
  6. 如何恢复计算机工具栏,电脑任务栏怎么还原,教您怎么还原电脑任务栏
  7. |sex[]_sum[],G_ans|L2-028 秀恩爱分得快
  8. 基于工业级4G5G路由器大型设备远程无线监控方案
  9. linux安装php-java-bridge
  10. 运用R语言(ggplot2包)绘制箱式图