Ubuntu18.0.4使用笔记

分辨率修改

#查看分辨率
xrandr
#修改分辨率
xrandr -s 1440x1050
  • root模式进入 sudo su

  • 高级权限图形文件操作 sudo nautilus

修改apt-get访问地址详细链接

#备份文件
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
#打开文件
sudo gedit /etc/apt/sources.list
寻找阿里、清华镜像修改就行
修改后更新
sudo apt-get update
sudo apt-get upgrade

能够和主机间复制文件,3个代码就够了详情借鉴

sudo apt-get autoremove open-vm-tools
sudo apt-get install open-vm-tools
sudo apt-get install open-vm-tools-desktop

Ubuntu安装anaconda,在官网下载linux文件,在文件目录,选择在当前目录打开终端,输入sh Anaconda3-2018.12-Linux-x86_64.sh

enter > yes > /home/zrq/anaconda3 > yes到此安装完成
安装VSCODE我选择的 no

  • Ubuntu安装Pycharm,在Ubuntu软件搜索Pycharm,点击安装就可以

美化Ubuntu

sudo apt-get update
#安装软件优化
sudo apt install gnome-tweak-tool
#拓展工具打开
sudo apt install gnome-shell-extensions
#安装后打开连接[安装浏览器插件](https://extensions.gnome.org/)
sudo apt install chrome-gnome-shell 
#点开User Themes,开关点成ON

[主题下载](https://www.opendesktop.org/s/Gnome/browse/cat/135/)
[图标下载](https://www.opendesktop.org/s/Gnome/browse/cat/132/)
主题解压放在/usr/share/themes/
图标放在/usr/share/icons/
此时就可以在优化中调整主题、图标了

Ubuntu18.0.4安装mysql

#安装
sudo apt-get update
sudo apt-get install mysql-server
#安装配置
sudo mysql_secure_installation
#过程如下
Press y|Y for Yes, any other key for No: N
Please set the password for root here.
New password: 
Re-enter new password: 
Remove anonymous users? (Press y|Y for Yes, any other key for No) : N

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : Y
Success.

Remove test database and access to it? (Press y|Y for Yes, any other key for No) : N

Reload privilege tables now? (Press y|Y for Yes, any other key for No) : Y
Success.
All done! 
N  > 密码 > N > Y > N > Y

#服务管理启动:sudo service mysql start
#服务启动:sudo systemctl mysql start
#停止:sudo service mysql stop
#服务状态:sudo service mysql status
#重启Mysql:sudo service mysql restart
#连接数据库:mysql -h 127.0.0.1 -P 3306 -uroot -p123456 #-h为远程IP,-P为端口号,-u为用户名,-p为密码
#退出mysql:quit
#显示数据表:show databases;
#登录MySql数据库:mysql -u root -p 

mysql远程访问实现 借鉴博客超级详细

#查找bind-address:127.0.0.1,将其注释掉
/etc/mysql/mysql.conf.d/mysqld.cnf
#或者直接使用sudo nautilus
和Windows一样,打开文件,修改它

#进入mysql
sudo mysql -u root -p
#设置能通过root账户远程访问
grant all privileges on *.* to 'root'@'%' identified by 'xxxxxx';
#大概是执行命令的意思
flush privileges;

#如果出现密码不符合规律(在mysql里面输命令)
#修改密码登记
set global validate_password_policy=0;
#查看密码长度
select @@validate_password_length;
#修改密码
set password=Password('****');
#重新登录
sudo -u -root -p

Ubuntu18.0.4安装MongoDB

#安装
#!!!一定不要找官方那个4步走来,我的一直出错!!!搞了2天,才安装成功
直接!!!!,镜像源会出现下面问题
无法下载 https://repo.mongodb.org/apt/ubuntu/dists/bionic/mongodb-org/4.0/InRelease  无法连接上 repo.mongodb.org:443 (52.84.44.48)。 - connect (111: 拒绝连接)

sudo apt-get install mongodb
等待安装完成就行

#查看MongoDB运行状态
sudo service mongodb status

#关闭与启动
sudo service mongodb stop 
sudo service mongodb start
sudo service mongodb restart

#配置文件修改mongod.conf
/etc/mongod.conf 

测试连接用robo 3T

#创建账户
use admin
#创建
db.createUser(
  {
    user: "zrq",
    pwd: "*******",
    roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]
  }
)
#验证账户
db.auth("zrq","******")

#开放端口:sudo ufw allow  27017
#重启防火墙:sudo service ufw restart

猜你喜欢

转载自blog.csdn.net/qq_31235811/article/details/88706453