首页 > 数据库 >mysql安装以及配置

mysql安装以及配置

时间:2022-10-11 20:45:55浏览次数:50  
标签:help 配置 apt 登陆 mysql mycli 安装

mysql安装

执行命令apt list | grep "mysql"查找mysql软件包
找到软件包,执行apt install mysql-server-8.0/focal-security安装mysql
执行mysql进入mysql

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY "123456";
Query OK, 0 rows affected (0.01 sec)

mysql> exit;
Bye

修改密码为123456
下次登陆使用命令mysql -uroot -p,然后输入密码登陆

mycli安装

mycli是一个mysql命令行工具,具有sql语句提示的功能

输入apt install mycli安装mycil
使用方法
登陆mycli -uroot,然后输入密码登陆

标签:help,配置,apt,登陆,mysql,mycli,安装
From: https://www.cnblogs.com/hongwei408/p/16782491.html

相关文章