MySQL Install In Ubuntu

本文介绍如何在Ubuntu系统上安装MySQL数据库及图形界面管理工具mysql-workbench。包括使用命令行安装MySQL客户端和服务端,设置初始密码,以及通过mysql-workbench进行图形化操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.Install MySQL

Unbuntu has provided a convenient way to install MySQL,you just need to scan lower command in the terminal,the unbuntu will help you install MySQL automaticly.

sudo apt install mysql-client-core-5.7   
sudo apt install mariadb-client-core-10.1
sudo apt-get install mysql-server

When you install mysql,system may remind you set initial password,or may not.If in the install processing,it remind you set the password,you just need to set and remeber you password,then you can jump to step2.If you are unlucky like me,you should to change you password in the lower way.

sudo cat /etc/mysql/debian.cnf

 

 As can be see,you My password is : pV3OLBUQffd5ClSO,and then scan lower command in your terminnal,but you should change the "user" and the "password",in the lower command, -u means user,-p means password.and then you can enter you mysql.

mysql -u debian-sys-maint -ppV3OLBUQffd5ClSO

Now you need to change your password and remenber it,for this,lower commands will help you.INn this place my new username is "root" and my password is "root" also.

use mysql;
//here is you new user name and password
update mysql.user set authentication_string=password('root') where user='root' and Host ='localhost';
update user set plugin="mysql_native_password"; 
quit;

Now,you can restart the mysql and login use your new username and password.

sudo service mysql restart
mysql -u root -proot

2.Install mysql-workbench

mysql-workbench is a a nice graphical interface of MySQL in ubuntu,and it's installing method is also easy,after you install mysql-workbench,you will surprise the convenience to use.

sudo apt-get install mysql-workbench
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值