Python之Web开发中级教程----ubuntu安装MySQL

Python之Web开发中级教程----ubuntu安装MySQL

  1. 进入/opt目录

cd /opt

  1. 更新软件源

sudo apt-get upgrade

sudo apt-get update

3、安装Mysql server

sudo apt-get install mysql-server

4、启动Mysql

service mysql start

5、确认Mysql的状态

service mysql status

6、安全设置(设置root密码,移除匿名用户,禁止root远程访问等):

MySQL安装随附一个名为的脚本mysql_secure_installation,可让您轻松提高数据库服务器的安全性。

调用不带参数的脚本:

sudo mysql_secure_installation

系统将要求您配置VALIDATE PASSWORD PLUGIN用来测试MySQL用户密码强度并提高安全性的密码:

Securing the MySQL server deployment.

Connecting to MySQL using a blank password.

VALIDATE PASSWORD COMPONENT 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 component?

Press y|Y for Yes, any other key for No: y

密码验证策略分为三个级别:低,中和强。按下y如果你想设置的验证密码插件或任何其他键移动到下一个步骤:

There are three levels of password validation policy:

LOW Length >= 8

MEDIUM Length >= 8, numeric, mixed case, and special characters

STRONG Length >= 8, numeric, mixed case, special characters and dictionary file

Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 2

在下一个提示符下,将要求您设置MySQL root用户的密码:

Please set the password for root here.

New password:

Re-enter new password:

如果您设置了验证密码插件,该脚本将向您显示新密码的强度。键入y以确认密码:

Estimated strength of the password: 50

Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y

接下来,将要求您删除匿名用户,限制root用户对本地计算机的访问,删除测试数据库并重新加载特权表。您应该回答y所有问题。

7、安装Mysql客户端

sudo apt-get install mysql-client /// 客户端

8、安装开发接口

sudo apt-get install libmysqlclient-dev /// 开发接口

9、登入mysql

Sudo mysql -u root -p

相关推荐
如夏倾城16 分钟前
VRRP(虚拟路由器冗余协议Virtual Router Redundancy Protocol)
网络·python·网络协议·安全·智能路由器·负载均衡·信息与通信
IvanCodes41 分钟前
LangChain(04):Runnable 与 LCEL 的执行与组合机制
python·langchain·agent
码少女42 分钟前
MySQL--库与表的增删改查基础
java·数据库·mysql
Eyfcom1 小时前
〖物流 SaaS 实战 02〗SaaS 租户的计费与订阅模型:从“一锤子买卖”到“按需订阅”
linux·服务器·数据库·快递系统·物流saas实战
特创数字科技1 小时前
纯本地离线运行的文档脱敏工具(技术分享)
前端·驱动开发·python
打工的小王1 小时前
postgresql和mysql对比
数据库·mysql·postgresql
布莱克6052 小时前
Swift 循环与控制转移详解:从 for-in 到标签跳转
开发语言·ssh·swift·循环
东莞市云毅网络有限公司2 小时前
用 Playwright 搭一套问答平台引用监测的最小骨架
python·数据清洗·rag·企业知识库·文档解析
Thanks_ks2 小时前
【第 010 讲】全面掌握 Python 变量与常量:变量的定义与赋值 | 标识符与命名规范 | 变量的底层机制 | 常量与魔术数字
python·内存·变量·标识符·常量·赋值·命名规范
敲上瘾3 小时前
Qt核心机制:信号与槽详解
开发语言·c++·qt·ui·qt6.3