举例:忘记root密码
[root@localhost ~]# /etc/init.d/mysqld stop [root@localhost ~]# mysqld_safe --port=3329 & [root@localhost ~]# ss -lntp State Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 128 *:22 *:* users:(("sshd",pid=781,fd=3)) LISTEN 0 128 :::3329 :::* users:(("mysqld",pid=2595,fd=29)) LISTEN 0 70 :::33060 :::* users:(("mysqld",pid=2595,fd=32)) LISTEN 0 128 :::22 :::* users:(("sshd",pid=781,fd=4)) [root@localhost ~]# mysql -uroot -p123456
[root@localhost ~]# mysqld_safe --skip-grant-tables --skip-networking &
[root@localhost ~]# mysql
配置文件的加载顺序
[root@localhost ~]# mysqld --help --verbose|grep my.cnf
/etc/my.cnf /etc/mysql/my.cnf /usr/local/mysql/etc/my.cnf ~/.my.cnf
初始化配置文件应用
mysql配置文件格式
[标签] 配置=xxx 配置=xxx 配置=xxx …
[标签]
标签分为两种
server端:
[server]
[mysqld]
[mysqld_safe]
client端(只影响本地连接,不影响远程):
[client]
[mysql]
[mysqldump]
调用非默认路径配置文件
mysqld_safe --defaults-file=配置文件路径 &
MySQL8.0初始化配置方式 ——维护使用
标签:mysql8 cli dql mysqld err erro class 通过命令 mysqldump