1. 准备好配置文件 my.cnf
2.建立my.cnf中用到的必要的目录
3.在mysql目录下有个scripts/mysql_install_db, 执行:
scripts/mysql_install_db --defaults-file=/opt/etc/my.cnf --user=mysql
4.启动服务
/opt/mysql/bin/mysqld_safe --defaults-file=/opt/io_nvme/mysql_thresholds/etc/my.cnf &
5. 修改密码
/opt/mysql/bin/mysqladmin -u root password ‘123456‘ --socket=/opt/data/mysqld.sock
/opt/mysql/bin/mysqladmin -u root -h your_host_name password ‘123456‘ --socket=/opt/data/mysqld.sock
6.登陆验证
bin/mysql -uroot --socket=/opt/io_nvme/mysql_thresholds/data/mysqld.sock
时间: 2024-11-05 11:31:59