Mysql数据库自建,使用,问题排查最佳实践 transactionwritesetextractionMURMUR32 defaultauthenticationpluginmysqlnativepassword mysql 8.4版本之后不允许这样配置了,使用mysqlnativepasswordON可以正常使用 mysqlnativepasswordON defaultauthenticationplugincachingsha2password EOF [root@localhost install] chown R mysql.mysql /mysql 修改mysql目录的属组和属主 [root@localhost install] ll total 459M drwxrxrx 2 mysql mysql 6 Oct 8 17:04 data drwxrxrx 2 mysql mysql 6 Oct 8 17:04 file drwxrxrx 2 mysql mysql 6 Oct 8 17:04 log rwrr 1 mysql mysql 3.5K Oct 8 17:13 my.cnf lrwxrwxrwx 1 mysql mysql 34 Oct 8 17:08 mysql > mysql8.4.0linuxglibc2.28x8664 drwxrxrx 9 mysql mysql 129 Oct 8 17:07 mysql8.4.0linuxglibc2.28x8664 rwrr 1 mysql mysql 459M Oct 8 17:04 mysql8.4.0linuxglibc2.28x8664.tar.xz drwxrxrx 2 mysql mysql 6 Oct 8 17:04 tmp 初始化数据库 plaintext [root@localhost install] /mysql/install/mysql/bin/mysqld defaultsfile/mysql/install/my.cnf initialize usermysql basedir/mysql/install/mysql datadir/mysql/install/data [root@localhost log] grep 'temporary password' /mysql/install/log/hirierror.err 20241008T17:34:43.831698+08:00 6 [Note] [MY010454] [Server] A temporary password is generated for root@localhost: ,H4xd+oy0M>t 启库并修改密码 plaintext [root@localhost install] /mysql/install/mysql/bin/mysqldsafe defaultsfile/mysql/install/my.cnf datadir/mysql/install/data pidfile/mysql/install/mysql.pid & [1] 2152 [root@localhost install] 20241008T11:26:28.216260Z mysqldsafe Logging to '/mysql/install/log/hirierror.err'. 20241008T11:26:28.470158Z mysqldsafe Starting mysqld daemon with databases from /mysql/install/data [root@localhost install] mysqladmin uroot p',H4xd+oy0M>t' password 'redhat' S /mysql/install/mysql.sock mysqladmin: [Warning] Using a password on the command line interface can be insecure. Warning: Since password will be sent to server in plain text, use ssl connection to ensure password safety.