mysql 8.0.23 在Ubuntu上的安装
0. mysql 版本
$ mysql -V
mysql Ver 8.0.23-3ubuntu1 for Linux on x86_64 ((Ubuntu))
1. 安装mysql
sudo apt -y install mysql-server
sudo apt -y install mysql-client
sudo apt -y install libmysqlclient-dev
2. 测试安装成功
ps -elf | grep slurmd
3. 修改mysql root密码
sudo cat /etc/mysql/debian.cnf
[client]
host = localhost
user = debian-sys-maint
password = AVA4e2LCnATA1FF4
socket = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host = localhost
user = debian-sys-maint
password = AVA4e2LCnATA1FF4
socket = /var/run/mysqld/mysqld.sock
//使用上面的用户和密码登进mysql,然后修改mysql root用的密码
use mysql;
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '你的密码';
flush privileges;
quit
//重新用root用户登录mysql就好了
$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 8.0.23-3ubuntu1 (Ubuntu)
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
或者更厉害的方法是: