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

相关推荐
GZ_TOGOGO3 分钟前
Oracle数据库考试适合哪些人
数据库·oracle·数据库开发·ocp认证·2026年it学习
Gauss松鼠会4 分钟前
【openGauss】学习 gsql 命令行的使用
数据库·sql·database·opengauss
CCPC不拿奖不改名7 分钟前
python基础面试编程题汇总+个人练习(入门+结构+函数+面向对象编程)--需要自取
开发语言·人工智能·python·学习·自然语言处理·面试·职场和发展
晓13139 分钟前
第二章:Redis常见命令与Java客户端
java·数据库·redis
2501_9444241214 分钟前
Flutter for OpenHarmony游戏集合App实战之数字拼图滑动交换
android·开发语言·flutter·游戏·harmonyos
我送炭你添花14 分钟前
Pelco KBD300A 模拟器:10.报警联动规则编辑与执行
python·自动化·运维开发
·云扬·18 分钟前
MySQL索引实战指南:添加场景、联合索引要点与失效场景解析
数据库·mysql
偷星星的贼1119 分钟前
C++中的访问者模式实战
开发语言·c++·算法
填满你的记忆29 分钟前
【从零开始——Redis 进化日志|Day7】双写一致性难题:数据库与缓存如何不再“打架”?(附 Canal/读写锁实战)
java·数据库·redis·缓存·面试
小白考证进阶中30 分钟前
MySQL OCP认证可以考中文?备考难度怎么样?
数据库·mysql·dba·数据库管理·开闭原则·数据库管理员·mysql认证