当前位置:   article > 正文

Ubuntu 24.04 LTS 安装配置 MySQL Community Server 8.4.0 LTS_ubuntu24安装mysql

ubuntu24安装mysql

1 安装 Apt Repository

​​​​​​​地址MySQL :: Download MySQL APT Repository

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

 

  1. #安装mysql 8.4 lts
  2. sudo apt update
  3. sudo apt-get install mysql-server

#修改mysql root密码策略

 2 查看版本

  1. test@test:~$ mysqld --version
  2. /usr/sbin/mysqld Ver 8.4.0 for Linux on x86_64 (MySQL Community Server - GPL)

3 启动服务

  1. #启动
  2. sudo systemctl start mysql
  3. #开机启动
  4. sudo systemctl enable mysql
  5. #查看服务状态
  6. sudo systemctl status mysql

  1. #查看端口运行
  2. test@test:~$ sudo netstat -tnupl| grep mysql
  3. tcp6 0 0 :::3306 :::* LISTEN 9225/mysqld
  4. tcp6 0 0 :::33060 :::* LISTEN 9225/mysqld

4 修改mysql root 密码

  1. #默认密码为空
  2. sudo mysql -uroot -p
  3. ALTER USER 'root'@'localhost' IDENTIFIED BY '密码';
  4. flush privileges;

5 修改 配置文件

  1. sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
  2. bind-address = 0.0.0.0
  3. #重新启动
  4. sudo systemctl restart mysql

 

声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop】
推荐阅读
相关标签
  

闽ICP备14008679号