下载文件
wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.39-linux-glibc2.28-x86_64.tar.xz
解压到目录
在文件夹建立my.cnf
配置文件
[client]
port = 3309
socket = /data/mysql83309/mysqld.sock
[mysqld_safe]
socket = /data/mysql83309/mysqld.sock
[mysqld]
user = mysql
pid-file = /data/mysql83309/mysqld.pid
socket = /data/mysql83309/mysqld.sock
port = 3309
basedir = /data/mysql83309
datadir = /data/mysql83309/data
tmpdir = /tmp
初始化
sudo bin/mysqld --defaults-file=/data/mysql83309/my.cnf --initialize --user=mysql --lower_case_table_names=1
启动
sudo bin/mysqld --defaults-file=/data/mysql83309/my.cnf --user=mysql &
登录
bin/mysql -uroot -p -S /data/mysql83309/mysqld.sock
关闭
bin/mysqladmin -uroot -p'Newland123!' -S /data/mysql83309/mysqld.sock shutdown
更改root用户密码
注意语句后的; 执行语句忘记写了 可以补个空的;回车也可以将语句执行
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';
flush privileges;
更改root连接权限
use mysql;
update user set host='%' where user = 'root';
flush privileges;
标签:多个,--,安装,sock,mysqld,mysql,mysql83309,data From: https://www.cnblogs.com/qun-/p/18336904