ubuntu18.04使用Mysql指令

文章目录前言 一、pandas是什么? 二、使用步骤 1.引入库 2.读入数据 总结前言在使用Ubuntu中,对MySQL不熟悉,在实践中不断总结,不断更新。一、安装MySQL;Linux通用三句话。直接一句一句的怼上去就OK。1、更新```sudo update```二、使用步骤1.引入库代码如下(示例):import numpy as np import pandas as pd import matplotlib.pyplot
摘要由CSDN通过智能技术生成

前言:

在使用Ubuntu中,对MySQL不熟悉,在实践中不断总结,不断更新。

目录

前言:

在使用Ubuntu中,对MySQL不熟悉,在实践中不断总结,不断更新。

一、安装MySQL

1、更新

2、安装数据库

3、查看版本

二、sql语句

1.启动、重置、关闭mysql:

2.查看是否启动:

三、遇到的BUG和解决方案

1、qt for ros(Ubuntu18.04)无法支持数据库。

2、使用mysql -u root -p命令无法进入mysql: 

解决:进入root权限,直接修改文件cnf,再修改root属性

3、解决中文编码:原文链接:原文

mysql的关键词:





一、安装MySQL

Linux通用三句话。直接一句一句的怼上去就OK。

1、更新

sudo apt update

2、安装数据库

sudo apt-get install -y mysql-server mysql-client






3、查看版本

mysql -V

初始化配置,设置密码:

sudo mysql_secure_installation

出现下面界面,一项一项进行配置:

#1
VALIDATE PASSWORD PLUGIN can be used to test passwords...
Press y|Y for Yes, any other key for No: N (我的选项)

#2设置密码
Please set the password for root here...
New password: (输入密码)
Re-enter new password: (重复输入)

#3、删除匿名用户?
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...
Remove anonymous users? (Press y|Y for Yes, any other key for No) : N (我的选项)

#4禁止远程root登录?
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) : Y (我的选项)

#5
By default, MySQL comes with a database named 'test' that
anyone can access...
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : N (我的选项)

#6立即重新加载权限表
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 (我的选项)
 

二、sql语句





1.启动、重置、关闭mysql:

  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值