How to Install MySQL 8 onUbuntu 20.04, 22.04, or later

1 - Download and install MySQL 8.0 APT Repository

First of all, you need to download the latest release package using the wget command:

wget https://dev.mysql.com/get/mysql-apt-config_0.8.12-1_all.deb

Next, you need to install the MySQL package. For this, execute the command below:

sudo dpkg -i mysql-apt-config_0.8.15-1_all.deb

In the Package configuration window that appears, select the first option and then select OK.

In the next window, select mysql - 8.0 and hit Enter to continue.

And finally, select the last option and press Enter to proceed:

Next, update the APT repository:

sudo apt update

2 - Install MySQL 8.0

Now, you need to run the below command to install MySQL server and client. Press Y to begin the installation, then insert a password for the root user when asked.

sudo apt install -f mysql-client=8.0* mysql-community-server=8.0* mysql-server=8.0*

In the next windows, provide a password for the root user, read the information about the authentication system based on SHA256-based password methods, and choose the authentication plugin. The installation will proceed, and MySQL 8.0 will be installed in your system.

3 - Check MySQL version

To make sure, that the installation has been successful, run the following command:

mysql –V

If you need more information about your MySQL server, run: 

mysqladmin -u root -p version

4 - Create a MySQL user 

To create a new MySQL user account on Ubuntu, execute the following command:

CREATE USER 'username'@'localhost' IDENTIFIED BY 'user_password';

Note

To allow a user remote access to MySQL on Ubuntu, we recommend creating a user with access from any host ('username'@'%') or from a specific IP address ('username'@'192.168.1.100'). 

refer link: How to install MySQL 5.7 or 8 on Ubuntu 18.04, 20.04, 22.04

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值