当前位置:Gxlcms > 数据库问题 > 【教程】Linux上安装MySQL

【教程】Linux上安装MySQL

时间:2021-07-01 10:21:17 帮助过:12人阅读

相比Windows系统,Linux系统上安装MySQL比较简单,本文将详细介绍如何在Ubuntu系统安装MySQL。

PART 1 安装MySQL

1.更新软件源

sudo apt update

2.安装MySQL

sudo apt-get install mysql-server
sudo apt-get isntall mysql-client
sudo apt-get install libmysqlclient-dev

3.确认安装成功

# 输入以下命令能进入mysql则安装成功
mysql -u root -p 

PART 2 MySQL常用命令

# 查看数据库
show databases;
# 添加用户
grant all privileges on testDB.* to test@localhost identified by ‘1234‘;

grant select,update on testDB.* to test@localhost identified by ‘1234‘;

grant select,delete,update,create,drop on *.* to test@"%" identified by "1234";

grant all privileges on testDB.* to test@localhost identified by ‘1234‘;

flush privileges; //刷新系统权限表

【教程】Linux上安装MySQL

标签:create   linu   linux   bash   sel   server   教程   数据库   lin   

人气教程排行